Squaring equations

1. May 22, 2009

Mentallic

Note: This problem is no longer a homework question.

1. The problem statement, all variables and given/known data
I'm asked to find the max value of $\sqrt{3}cosx+sinx$

2. Relevant equations
$y=sinx,y'=cosx$
$y=cosx, y'=-sinx$
$cos^2x=1-sin^2x$

3. The attempt at a solution
I let $y=\sqrt{3}cosx+sinx$

Hence, $$\frac{dy}{dx}=-\sqrt{3}sinx+cosx=0$$

Attempting to solve this for x: $$\sqrt{3}sinx=cosx \Rightarrow 3sin^2x=1-sin^2x$$

Finally, $$sinx=\pm\frac{1}{2} \Rightarrow x=\pi n\pm \frac{\pi}{6}$$ , n integral

I tested these values on a graphing calculator for $0\leq x\leq 2\pi$ because I didn't believe that there should be 4 max/min values, but only 2-3. I found that $\pi/6$ and $7\pi/6$ were max/min values but $5\pi/6$ and $11\pi/6$ were rather just random points on the function and its derivative.

So I'm guessing that I found extra wrong values when I squared both sides of the derivative? Is it possible to square the equation, but quickly find which values in the results aren't valid and need to be scrapped? After solving the equation this way, I realized that the values that are valid are located in the first and third quadrants which are both positive for the tangent function and thus I could've divided the derivative through by $cosx$.

2. May 23, 2009

alligatorman

This doesn't answer your question, but I find it to be another nice way of solving the problem.

Notice that $$\sqrt{3}^2+1^2=2^2$$.

So If you divide both sides of the equation by 2, you get:

$$\frac{y}{2}=\frac{\sqrt{3}}{2}}\cos(x)+\frac{1}{2}\sin(x)=\sin(\pi/3)\cos(x)+\cos(\pi/3)\sin(x)=\sin(x+\pi/3).$$

So $$y=2\sin(x+\pi/3)$$, whose maximum value is 2.

It can be shown similarly that if $$y=A\cos(x)+B\sin(y)$$, then the maximum is just $$\sqrt{A^2+B^2}.$$

3. May 23, 2009

HallsofIvy

Staff Emeritus
When you square both sides of an equation, as you do here, you may introduce new solution that do not satisfy your original equation. For an obvious example, x= 2 has the single solution 2 but x2= 4 has both 2 and -2 as solutions.

The simplest way to distinguish "extraneous solutions" is to try them in the original equations.

But I don't see any reason to square both sides: there is no square root of the unknown and $\sqrt{3}$ is just a number. From $-\sqrt{3}sin(x)+ cos(x)= 0$, $\sqrt{3}sin(x)= cos(x)$ so
$$\frac{sin(x)}{cos(x)}= \frac{1}{\sqrt{3}}$$
which leads to $\pi/6$, as a "fundamental solution" and, since tan(x) is periodic with period $\pi$, $x= \pi/6+ n\pi$ as general solution, no "-".

4. May 23, 2009

Mentallic

I cannot figure out what the significance of $\sqrt{3}^2+1^2=2^2$

Also, I already deduced before posting that $\sqrt{3}cosx+sinx=2cos(x-\frac{\pi}{6}$ but you have showed me another way of finding that. thanks

I'll test in the original function in future then. I didn't realize this, thanks! It's way simpler to solve this way.

5. May 23, 2009

arildno

Furthermore, knowing where the critical points lie, we may use the second derivative to find out which of those x's are maxima:
$$f''(x)=-\sqrt{3}\cos(x)-\sin(x)=-\cos(x)(\sqrt{3}+\frac{\sin(x)}{\cos(x)})$$
At the critical points, we get here the value:
$$-\cos(x)(\sqrt{3}+\frac{1}{\sqrt{3}})$$, which shows that the maxima will occur for critical x's lying in the first quadrant, never in the fourth.

6. May 23, 2009

alligatorman

You want to divide both sides of the equation by some C such that $$\sin(\alpha)=\sqrt{3}/C$$ and $$\cos(\alpha)=1/C.$$ (So that we can use the trig summation identity)

Then it must be true that $$(\sqrt{3}/C)^2+(1/C)^2=1$$. It follows that $$C^2=3+1.$$

So in general, for $$y=A\cos(x)+B\sin(y)$$, you want to divide by $$\sqrt{A^2+B^2}$$. Then you can write $$y=\sqrt{A^2+B^2} \cdot \sin(\alpha+x).$$

Sorry for hijacking the thread. Just wanted to share a neat trick that could come in handy in other places. :tongue2:

7. May 23, 2009

HallsofIvy

Staff Emeritus
The signicance is that its positive square root, 2, is the answer to your original question!
Your problem did not ask for the value of x that gives that.

Alligatorman's point is that, sin(x+ y)= cos(x)sin(y)+ sin(x)cos(y) so if you have something of the form Acos(x)+ Bsin(x), you can look for a "y" such that sin(y)= A, cos(y)= B. Of course, because $sin^2(y)+ cos^2(y)= 1$, that is only possible if $A^2+ B^2= 1$. If not, as in this case where $A= \sqrt{3}$ and B= 1, we must multiply and divide by $\sqrt{A^2+ B^2}$. Here, of course, $A^2+ B^2= 3+1= 4$ so $\sqrt{A^2+ B^2}= 2$. If we multiply and divide by 2, we have
$$2\left(\frac{\sqrt{3}}{2}cos(x)+ \frac{1}{2}sin(x)\right)$$.
There does exist y such that $sin(x)= \sqrt{y}/2$ and $cos(y)= 1/2$. It easy to see that $y= \pi/6$ satisfies that but we don't need to: this is of the form 2 sin(x+y) which we know has a maximum value of 2 because sine itself has a maximum value of 1.

8. May 23, 2009

Mentallic

Ahh thanks for all your help everyone!
Alligatorman, I appreciate your attempts but without Hallsofivy's response I still wouldn't have understood it clearly. But don't worry, thats just due to my feable abilities to understand simple math