How do I rewrite y = sinx + (sqrt(3))*(cosx) into the form of sinx(a+b)?
In general, if you have Asin(x)+ Bcos(x) you can write it as either a sine or cosine function.
sin(a+b)= sin(a)cos(b)+ cos(a)sin(b) so if you can find "b" so that cos(b)= A and sin(b)= B you have it. Of course, in that case, $\displaystyle A^2+ B^2= cos^2(b)+ sin^2(b)= 1$ so you must first have $\displaystyle A^2+ B^2= 1$. In your problem, A= 1 and $\displaystyle B= \sqrt{3}$ so $\displaystyle A^2+ B^2= 1+ 3= 4$, not 1. That was why alexmahone factored out $\displaystyle 2= \sqrt{4}$ first.
For any A sin(x)+ B cos(x), We can write $\displaystyle A sin(x)+ B cos(x)= \sqrt{A^2+ B^2}\left(\frac{A}{\sqrt{A^2+ B^2}}sin(x)+ \frac{B}{/sqrt{A^2+ B^2}}cos(x)\right)$$\displaystyle = \sqrt{A^2+ B^2}sin(x+ \theta)$ where $\displaystyle cos(\theta)= \frac{A}{\sqrt{A^2+ B^2}}$ and $\displaystyle sin(\theta)= \frac{B}{\sqrt{A^2+ B^2}}$. Since $\displaystyle tan(\theta)= \frac{sin(\theta)}{cos(\theta)}= \frac{B}{A}$, $\displaystyle \theta= \arctan\left(\frac{B}{A}\right)$
To write A sin(x)+ B cos(x) as a cosine, use cos(a+b)= cos(a)cos(b)- sin(a)sin(b) and do the same thing.