1
$\begingroup$

I am currently stuck on the part where we make the first derivative of a function equal to 0, I tried using trig identities and such but I couldn't make it zero.

we are given the following:

$$f(x) = 2x\cos(2x) - (x-2)^2, [2,4]$$

I find the derivative to be:

$$2\cos(2x) - 4x(\sin(2x)) - 2(x-2) = 0$$

At this point I am stuck with trying to either find the undefined or points in general that make the function (f'(x)) equal to 0. How do I approach solving for x?

  • 0
    Is this an exercise for numerical calculation?2017-01-08
  • 0
    It's a review question for "Numerical Analysis", so it may seem really obvious to you and others.2017-01-08
  • 0
    I did graph it, and see where the maximum was, but that doesn't teach me how to find out what 'x' should be to make the first derivative equal to 0.2017-01-08
  • 0
    Have you learned Newton's method?2017-01-08
  • 0
    Then you could have asked your question in a better way by adding the "numerical analysis" information to your question. And all one needs now is to solve the equation $f'(x)=0$ numerically.2017-01-08
  • 0
    Was my thought on using trig identities to solve it correct, or am I missing something else as well?2017-01-08
  • 0
    trig identities won't save you here.2017-01-08
  • 0
    Ah darn, so what would be the best way for me to solve it by hand?2017-01-08
  • 0
    You have already said that this is a review question for "numerical analysis". Why would you expect that one should solve it by hand??2017-01-08

2 Answers 2

1

$$f'(x)=2\cos(2x)-4x\sin(2x)-2(x-2)$$ \begin{align}f''(x)&=-4x\sin(2x)-4\sin(2x)-8x\cos(2x)-2 \\&=-4(x+1)\sin(2x)-8x\cos(2x)-2\end{align}

$$\frac{f'(x)}{f"(x)}=-\frac{\cos(2x)-2x\sin(2x)-2(x-2)}{2(x+1)\sin(2x)+4x\cos(2x)+1}$$

From Newton's method

$$x_{n+1}=x_n-\frac{f'(x_n)}{f"(x_n)}$$

I have coded some simple python code here:

http://www.codeskulptor.org/#user42_uBhUshL1Zh_0.py

the solution is roughly $3.13110627798$ and objective funciton $4.98143395755$

enter image description here

1

Just for the fun and for your curiosity.

If you plot the derivative of the function as a function of $x$, you should notice that it does cancel close to $x=\pi$. $$f'(x)=2\cos(2x)-4x\sin(2x)-2(x-2)\implies f'(\pi)=6-2\pi$$ Sooner or later, you will learn that we can approximate functions using the so-called Pade approximants which are ratios of polynomials.

The simplest one would be $$f'(x) \approx \frac{-\frac{2 \left(19+2 \pi +16 \pi ^2\right) (x-\pi )}{1+4 \pi }-2 (\pi -3)}{1-\frac{6 (x-\pi )}{1+4 \pi }}$$ the solution of which being "simply" $$x=\frac{6+60 \pi -4 \pi ^2+32 \pi ^3}{38+4 \pi +32 \pi ^2}\approx 3.131107220$$ while the "exact"solution (Siong Thye Goh obtained it using Newton method) is $\approx 3.131106279$