# Nonlinear IVPs and BVPs

Many real-world applications require the solution of IVPs and BVPs for nonlinear ODEs. For example, consider the logistic equation, which occurs in population dynamics.

This is the logistic equation.
 In[1]:=
The right-hand side of the equation can be expanded to a quadratic polynomial in y[t]. Hence, the logistic equation is simply a Riccati equation, and its general solution can be easily found.
 In[2]:=
 Out[2]=
This sets the intrinsic growth rate r to 1/2 and the saturation level K to 4 and solves the initial value problem. The warning message from Solve is issued while solving for the arbitrary constant C[1] from the general solution.
 In[3]:=
 Out[3]=
This solves the initial value problem for the logistic equation with symbolic parameters r and K.
 In[4]:=
 Out[4]=
This verifies that the solution satisfies the equation and the initial condition.
 In[5]:=
 Out[5]=
Here is a plot of the solution for different values of r and K.
 In[6]:=
 Out[6]=
Here is an example of an IVP for a second-order nonlinear ODE whose general solution can be obtained in explicit form.
 In[7]:=
 In[8]:=
 Out[8]=
This verifies that the solution satisfies the equation and the initial conditions.
 In[9]:=
 Out[9]=
Finally, here is a boundary value problem for a nonlinear second-order ODE. The solution is required to satisfy boundary conditions at 0 and infinity. The Solve::ifun message is generated while finding the general solution in terms of JacobiSN, the inverse of EllipticF. The DSolve::bvlim messages are given because the limit required for satisfying the condition y[Infinity]0 cannot be calculated for either branch of the general solution. However, the solution for the boundary value problem is found using an alternative method to determine the values of the constants C[1] and C[2] in the general solution.
 In[10]:=
 Out[10]=
 In[11]:=
 Out[11]=
 In[12]:=
 Out[12]=

It may not always be possible to obtain a symbolic solution to an IVP or BVP for a nonlinear equation. Numerical methods may be necessary in such cases.