Recently I was solving one question, in which I was solving for the smallest value of this expression

$$f(\theta)=\cos^2\theta-6\sin\theta \cos\theta+3\sin^2\theta+2$$

My first attempt:

$$\begin{align} f(\theta) &=3+2\sin^2\theta-6\sin\theta \cos\theta \\ &=3(1-2\sin\theta \cos\theta)+2\sin^2\theta \\ &=3(\sin\theta-\cos\theta)^2 + 2\sin^2\theta \end{align}$$

Hence the minimum value of $f(\theta)=2\sin^2\theta$ when $\theta=\pi/4$ hence minimum value of $f(\theta)=1$.

But then again I tried to do question differently by making substitutions in order to change the whole $f(\theta)$ in the form of $\cos x+\sin x$ Then $f(\theta)$ came out to be $$f(\theta)= 4-(\cos(2\theta)+3\sin(2\theta))$$ The minimum value of this expression is surely $$(f(\theta))_{min}=4-\sqrt{10}$$

Can anybody explain me algebraically why my first method gave the wrong result?

  • 1
    $\begingroup$ "Hence the minimum value of $f(\theta)=2\sin^2(\theta)$ when $\theta=\pi/4$ hence minimum value of $f(\theta)=1$" It has no sense ! $\endgroup$ – Surb Jun 29 '16 at 18:22
  • $\begingroup$ @Surb Why? If $\sin(\theta)-\cos(\theta)$ carry any value then its square would get added up on to the total terms as this is contained in a square and hence the minimum value would come when the $ \sin(\theta)-\cos(\theta)$=0. Is this wrong? $\endgroup$ – Harsh Sharma Jun 29 '16 at 18:24
  • $\begingroup$ and so ? this will not implies that $f(\theta)$ will be minimal at $\theta=\pi/4$ (as you can see). $\endgroup$ – Surb Jun 29 '16 at 18:28
  • $\begingroup$ Disregard the prior comment $\endgroup$ – Mark Viola Jun 29 '16 at 19:00

$f(\theta) = 4 - \sqrt{10}$ is correct.

so what is the error here:

$f(\theta) = 3(\sin \theta-\cos\theta)^2 + 2\sin^2\theta$

That part is a true statement but then you say.

Hence the minimum value of $f(θ)=2\sin^2θ,$ when $θ=π/4$ hence minimum value of $f(θ)=1.$

It is a logical jump that was a step too far.

If you had had,

$f(\theta) = 3(\sin \theta-\cos\theta)^2 + k$

it would be okay to zero out the term in parentheses. It must be greater than or equal to zero, so set it to zero.

But in your actual expression

$f(\theta) = 3(\sin \theta-\cos\theta)^2 + 2\sin^2\theta$

Minimizing either term doesn't minimize the sum.

Furthermore, when you say the minimum of $f(θ)=2\sin^2θ,$ occurs when $θ=\pi/4$ that is just wrong.

  • $\begingroup$ OK because the term outside too is a function of $\theta$, hence I can't use that thing. Thanks a lot sir. $\endgroup$ – Harsh Sharma Jun 29 '16 at 19:06

hint: Alternatively, using Lagrange Multiplier we have:

$x = \cos \theta, y = \sin \theta\implies f(x,y) = x^2-6xy+3y^2+2, x^2+y^2 = 1\implies f(x,y) = (x^2+y^2)+2y^2+2 - 6xy = 3-6xy+2y^2 \implies f_x = -6y= 2\lambda x, f_y = 4y-6x= 2\lambda y\implies4\lambda y - 6\lambda x = 2\lambda^2y\implies 4\lambda y+18y=2\lambda^2y\implies y(\lambda^2-2\lambda-9) = 0\implies y = 0 $ or $\lambda = 1\pm \sqrt{10}$ . Can you continue at this point?

  • $\begingroup$ Sir, I am in high school and we have not been taught about Lagrange multiplier, but I still appreciate your effort for helping me. Thanks a lot. $\endgroup$ – Harsh Sharma Jun 29 '16 at 20:32
  • 1
    $\begingroup$ You are welcome, and infact the LM is easy to learn. All you need is to solve the nabla equation $\nabla f = \lambda \nabla g$ $\endgroup$ – DeepSea Jun 29 '16 at 20:33
  • $\begingroup$ I am pretty curious to learn that. Would really appreciate, if you could help me with any handout or other information. And again Thanks a lot. $\endgroup$ – Harsh Sharma Jun 29 '16 at 20:34

$f'(\theta)=3(sin\theta-cos\theta)^2 + 2sin^2\theta = 6 (\sin\theta -\cos\theta )(\cos\theta + \sin\theta) + 4 \sin \theta \cos\theta$

$ =6 (\sin^2 \theta - \cos^2 \theta) + 4 \sin \theta \cos\theta =-6\cos(2\theta) +2\sin(2\theta)\ge 0 \implies \frac{2}{6} \tan (2\theta)\ge 1 $

$ \implies \tan(2\theta)\ge 3 \implies 2\theta\ge \arctan(3) \implies \theta \ge \arctan(3)/2 $

What that tells us is that first derivative is bigger than $0$ when $\theta \ge \arctan(3)/2$ that is function is growing and after that its smaller than $0$ - meaning its decreasing so we know that the function has a minimum in point $\theta = \arctan(3)/2$

With that $$ f(\theta)=\cos^2\theta-6\sin\theta \cos\theta+3\sin^2\theta+2=\frac{1+\cos(2\theta)}{2} - 3\sin(2\theta) +3\frac{1-\cos(2\theta)}{2} + 2=4-\cos(2\theta)-3\sin(2\theta) = 4-\frac{1}{\sqrt{10}} - 3\frac{3}{\sqrt{10}}=4 - \sqrt{10} $$

Since we know that $\cos^2 (2\theta)+\sin^2 (2\theta)=1 \implies 1+9=1/\cos^2 (2\theta) \implies cos^2(2\theta)=\frac{1}{10}$

  • $\begingroup$ Your answer is truly correct mathematically and I had also taken the derivative of the function. But can you just suggest me the reason why taking up $sin\theta=cos\theta$ to make the expression $ (\sin\theta-\cos\theta)^2=0$ would be wrong as this always comes as a positive terms and would get on to add to other factors increasing their value? $\endgroup$ – Harsh Sharma Jun 29 '16 at 18:29
  • 1
    $\begingroup$ Because making the first addend 0 does not mean that the sum of those two will be minimal. You need to figure in the second addend also! ($2\sin^2(2\theta)$) in your case. Example of what a flawed logic this is would be $x+ (x+2)^{100}$ You made the first 0 so you say the sum is zero but here its $2^{100}$ $\endgroup$ – daniels_pa Jun 29 '16 at 18:40
  • $\begingroup$ But if I choose $x=-2$ won't it still make the thing minimum i.e. x=-2 $\endgroup$ – Harsh Sharma Jun 29 '16 at 18:47
  • 1
    $\begingroup$ No. $x+(1+x)^2$ is not minimum when x is $0$ or when $x=-1$ because $x^2 +3x +1=0$ when we solve quadratic formula $\frac{-3\pm \sqrt{9-4}}{2}=\frac{-3\pm \sqrt{5}}{2}$ $\endgroup$ – daniels_pa Jun 29 '16 at 18:55
  • 1
    $\begingroup$ No problem do the derivative yourself on the $x+(x+2)^{100}$ and you will see that the minimum is not in -2 (but quite close to it) $\endgroup$ – daniels_pa Jun 29 '16 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.