What is the maximum value of the function x times cos(x)

298 Views Asked by At

I learned about polar functions last year in trig/pre-calc, and it got it me thinking about the function $r=\theta$. I found online that it was equal to $(t\cos(t),t\sin(t))$ in parametric form. So my question is how can I find an exact value for x that maximizes $f(x)$ for the function $f(t)=t\cos(t)$ with the domain $\{0<t<\pi/2\}$. `

3

There are 3 best solutions below

3
On

From

$$(x\cos x)'=\cos x-x\sin x=0$$ you know that the local extrema occur at the roots of this trascendental equation. They have no closed-form solution and you need to recourse to numerical methods, but there's an infinity of them.

You can rewrite the equation

$$x=\cot x$$ and observe that when $x$ is large, $x$ must be close to a multiple of $\pi$, let $k\pi+\delta$. Then

$$k\pi+\delta=\cot(k\pi+\delta)\approx\frac1\delta-\frac\delta3$$ from the Laurent series.

This gives the solutions

$$\delta=\frac{-3k\pi\pm3\sqrt{k^2\pi^2+\frac{16}3}}8.$$

The value for $k=0$ is $0.866$, not too bad.

0
On

The derivative is $f'(t)=\cos t-t\sin t$; since in the interval $(0,\pi/2)$ we have $\sin t>0$, the function is increasing for $$ t<\cot t $$ Let's consider $g(t)=t-\cot t$. We have $$ \lim_{t\to0^+}g(t)=-\infty, \qquad g(\pi/2)=\pi/2>0 $$ Also $$ g'(t)=2+\cot^2t>0 $$ over $(0,\pi/2)$. Hence the equation has a single point $t_0$ where it vanishes, so $f$ has an absolute maximum at $t_0$.

There is no “exact” value for $t_0$ or $f(t_0)$, but they can be computed within any accuracy with numeric methods. Knowing $t_0$ suffices, because $f(t_0)=t_0^2\big/\sqrt{1+t_0^2}$ (using $t_0=\cot t_0$).

0
On

If you consider that you are looking for the zero of $$f(t)=\cos(t)-t\sin(t)$$ egreg already showed that there is only one root in the interval $0\leq t\leq \frac \pi 2$.

By inspection $$f(\frac \pi 4)=\frac{4-\pi }{4 \sqrt{2}}\approx 0.152\qquad \text{and}\qquad f(\frac \pi 3)=\frac{3-\pi\sqrt{3} }{6}\approx -0.407$$ and a linear interpolation would give an approximate solution $t\approx 0.8565$.

If you want to improve it, you could use a Taylor expansion around $t=\frac \pi 4$ $$f(t)=\frac{4-\pi}{4 \sqrt{2}}-\frac{(8+\pi ) }{4 \sqrt{2}}\left(t-\frac{\pi }{4}\right)-\frac{(12-\pi ) }{8 \sqrt{2}}\left(t-\frac{\pi }{4}\right)^2+O\left(\left(t-\frac{\pi }{4}\right)^3\right)$$ Limited to first order, the solution of the linear equation is just $$\frac{\pi }{4}+\frac{12}{8+\pi }-1\approx 0.8624$$ Ignoring the higher order terms, you can solve the quadratic in $\left(t-\frac{\pi }{4}\right)$ the positive solution of which being $\approx 0.8602$ which is quite close to the solution.

For sure, as egreg answered, you can use a numerical solver such as Newton method for any accuracy. In the present case, Newton iterates would be $$\left( \begin{array}{cc} n & x_n \\ 0 & \frac \pi 4 \\ 1 & 0.86244346321224902980 \\ 2 & 0.86033497942478304319 \\ 3 & 0.86033358901998673659 \\ 4 & 0.86033358901937976248 \end{array} \right)$$ which is the solution for twenty significant figures.