$\sin\left(ax + \frac{\pi}{6}\right)$, find $a$ with given slope I was given a function
$$y = \sin\left(ax + \frac{\pi}{6}\right)$$
In the point $x = \frac{\pi}{12}$, the slope of the tangent line of that point is $\frac a2$.
I need to find $a$ if it's given that $1 \lt a \lt 4$.

I found the derivative of $y$, assigned the $x$ and compared it to the slope.
So at the end, if I did all the steps correctly, I get that
$$\frac 12 = \cos\left(\frac{\pi}{12}a + \frac{\pi}{6}\right)$$
I thought about using the identity of
$$ \cos(\alpha + \beta) = \cos\alpha \cos\beta - \sin\alpha \sin\beta$$
But didn't help.
My biggest problem is that I don't know how to use the information that $1 \lt a \lt 4$.

If $1<a<4$, then
$$\frac{\pi}{4}<\frac{\pi}{12}a + \frac{\pi}{6}<\frac{\pi}{2}$$
Since $\cos\left(\frac{\pi}{12}a + \frac{\pi}{6}\right)=\frac{1}{2}$ it follows 
$$\frac{\pi}{12}a + \frac{\pi}{6}=\frac{\pi}{3}$$
Hence, $$a=2$$
