# Solving nonlinear differential equations with Newton's method

I have difficulties with this equation

$$\frac{d^2 u}{d x^2} + u^2 - x^2 = 0$$

with boundary conditions: $u(0)=u(1)=0$

I do not know how to solve nonlinear differential equations with Newton's method. If somebody knows could you please explain?

I followed the comments and ı finally reach these two equations (eqn1 and eqn2). But my problem is that from now on , ı do not have any idea to combine these two equations. İf somebody has any idea, ı will be thankful so much for sharing with me. I just applied the newton raphson method

• Welcome! I edited your question a bit (improved its format, hope it still reads as you intended). What sort of difficulty did you encounter with Newton's method? Where do you get stuck? – GoHokies Oct 27 '15 at 15:43
• My problem is that I do not know how to apply Newtons method to nonlinear equations ? – Muaa2404 Oct 28 '15 at 12:16
• The first step is to read a bit about the fundamentals of Newton's method, then try it out on a very simple equation. Here is a reference to get you started; a Google search will yield lots more material. – GoHokies Oct 28 '15 at 13:07
• Thank you so much for your help. ı read your reference. ı finally reached the two equations (eqn1 and 2) but it is all I have nothing more to solve it. – Muaa2404 Oct 31 '15 at 20:34
• If the $u^2$ term was not there, could you solve the problem? In other words, are you comfortable with solving the linear problem? (this is prerequisite to solving the nonlinear problem via Newton's method) – GeoMatt22 Nov 1 '15 at 0:52

@GoHokies already had a good link to how to think about nonlinear problems. My own contribution is in lectures 31.5 and following here: http://www.math.tamu.edu/~bangerth/videos.html

This is a boundary value problem, not a root finding problem. One way to solve it is to replace the derivative with a finite difference, as you did, and iteratively relax to the correct solution.

I understood that you are trying to solve a nonlinear ODE with two Dirichlet conditions. The Newton method is applied to find the root numerically in an iterative manner. In this case, I would try a numerical method to solve this ODE. You could do this using Finite Element Method.

As this problem is nonlinear, you would need to apply the Newton's method. To apply the Newton Method's, you would need to do a Gateaux's differentiation.

After the Gateaux differentiation, you can then apply the Newton's method. The FEM method to discretize is not mandatory; there are other numerical methods. You can also try a simple Ritz method; it is even more direct.

You can use the Fenics software to do this (http://fenicsproject.org/documentation/tutorial/nonlinear.html).