# Finding max of $2x + 5\sqrt{1-x^2}$ using Newton's method

I'm trying to approximate the maximum of the function $f(x) = 2x + 5\sqrt{1-x^2}$ with $f'(x) = 2 - 5x(1-x^2)^{-0.5}$ but I've made a mistake, please help me.

The first step is $x_1 = x_0 - f(x_0) / f'(x_0)$. Supposing a first guess 0.4, this will give $x_1 = 0.4 - 5.382 / (- 0.182)$. I must have made a mistake because the maximum is $2/\sqrt(29)$ which is $0.3713$, so Newton's method is pushing me into the wrong direct

• The problem is that you are applying Newton's method to the original function. That helps find the roots of an equation. If you want to find a maximum, you need to use the first and second derivatives. (See en.wikipedia.org/wiki/Newton%27s_method) So it should look more like $x_1=x_0−\frac{f'(x_0)}{f′'(x_0)}$ Oct 29, 2016 at 21:28

The maximum of $2x+5y$ under the constraint $x^2+y^2=1$ can be easily found by Lagrange multipliers or just the Cauchy-Schwarz inequality: $$\left|2x+5y\right| \leq \sqrt{2^2+5^2}\sqrt{x^2+y^2} = \color{red}{\sqrt{29}}$$ and equality is attained at $(x,y)=\lambda(2,5)$, i.e. at $x=\frac{2}{\sqrt{29}}$.
In this case you may directly find $\max f(x)$ without even locating $\text{argmax}f(x)$ through $f'(x)=0$.
• @roflcomptroller: Newton's method is not unconditionally convergent and if you want to compute the maximum of $f$, you have to apply Newton's method to $f'$, leading to the iteration $$x \mapsto x-\frac{f'(x)}{f''(x)}$$ possibly convergent to $\text{argmax} f(x)$. Oct 29, 2016 at 21:29