Math216 Introduction to Differential Equations

Deniz Bilman, Department of Mathematics, University of Michigan

Lecture 2

Consider the first order ODE

\begin{equation}\label{eq:ODEgen} \frac{dy}{dt}=f(x,t). \end{equation}

This ODE describes how a quantity $y(t)$ changes with respect to the independent variable $t$ (can be time, distance from a point, or something else.) In this course we have two main goals:

  • Goal 1: Solve this ODE. This means describing the dependence of $y$ on $t$. The general solution can be expressed as an explicit function of $t$: $y(t)=\varphi(t)$, or this dependence can be expressed implicitly: $y^2 - y +t^3 = 22$, e.g.. If we know the solution (if we can plot it, for example) then we can do further analysis and answer questions such as:"What happens as to $y$ if $t\to+\infty?$", "Are there values of $t$ such that $y(t)$ is not defined?".
  • Goal 2: Even if we cannot solve this ODE, still say something about its solution. Perform a qualitative analysis to find the equilibrium solutions (if any), and classify them, for example. If possible, describe the direction field. This is what we also addressed in the first lecture.

In the first lecture, we realized that we can solve explicitly any autonomous ODE that is of the form

\begin{equation}\label{eq:} \frac{dy}{dx} = a\,y + b, \end{equation}

where $a$ and $b$ are real numbers. This is one class of ODEs that we can solve. Today we ask "are there other types of ODEs that we can directly solve (implicitly or explicitly)?" The answer is "Yes." The first example of a class of ODEs that we can solve is the so-called separable ODEs.

Separable Ordinary Differential Equations

In the remaining of this lecture we label the independent variable as $x$ instead of $t$. We do this because we want the student to be comfortable with different variables. Now consider the ODEs that are of the form

\begin{equation}\label{eq:ODEsep} \frac{dy}{dx} = p(x)\cdot q(y). \end{equation}

Such an ODE is separable: The derivative $\frac{dy}{dx}$ of the dependent variable $y$ is equal to the product of two functions: $p(x)$, which is a function of the independent variable $x$, and $q(y)$, which is a function of the dependent variable $y$. The structure of the right hand side enables us to formally rewrite the ODE \eqref{eq:ODEsep} as

\begin{equation}\label{eq:ODEsep2} p(x) - \frac{1}{q(y)}\frac{dy}{dx} = 0. \end{equation}

Now for convenience let's set

$$N(y) = -\frac{1}{q(y)}.$$

(The book also sets $M(x)=p(x)$ at this stage.) We then can rewrite the expression \eqref{eq:ODEsep2} as:

\begin{equation}\label{eq:ODEsep3} p(x) + N(y)\frac{dy}{dx} = 0. \end{equation}

Note that the ODE \eqref{eq:ODEsep3} is equivalent to the ODE \eqref{eq:ODEsep}. Therefore, ODEs of the form \eqref{eq:ODEsep3} are also called separable ODEs.

Let $H_1(x)$ be an antiderivative of $p(x)$:

$$p(x) = \frac{d}{dx} H_1 (x),$$

or, equivalently

$$\int p(x)\,dx = H_1(x).$$

Similarly, let $H_2(y)$ be an antiderivative (with respect to $y$) of $N(y)$:

$$\frac{d}{dy} H_2 (y) = N(y),$$

or, equivalently

$$H_2(y) = \int N(y)\,dy.$$

Now, since $y$ is a function $y(x)$ of $x$, $\frac{d}{dy} H_2 (y) = N(y),$ tells us that the second term on the left hand side of \eqref{eq:ODEsep3} is the derivative of $H_2(y(x))$ with respect to $x$ by the Chain Rule:

\begin{equation}\label{eq:term2} \frac{d}{dx} H_2(y(x)) = \frac{d H_2(y)}{dy}\cdot \frac{dy}{dx} = N(y)\frac{dy}{dx}. \end{equation}

Recalling also that $p(x) = \frac{d}{dx} H_1 (x)$, the ODE \eqref{eq:ODEsep3}

\begin{equation*} p(x) + N(y)\frac{dy}{dx} = 0 \end{equation*}

is equivalent to

\begin{align} \frac{d}{dx} H_1 (x) + \frac{d}{dx} H_2 (y(x)) &= 0\\ \frac{d}{dx}\Big(H_1 (x) + H_2 (y) \Big) &= 0\label{eq:ODEsep4}. \end{align}

This means that the ODE we started with can be written as the derivative of a function of $x$ with respect to $x$. We have

$$\frac{d}{dx}\Big(H_1 (x) + H_2 (y) \Big)=0$$

which implies that

\begin{equation}\label{eq:ODEsoln} H_1 (x) + H_2 (y) =c, \end{equation}

for some arbitrary integration constant $c$. The expression \eqref{eq:ODEsoln} is the general solution to the ODE \eqref{eq:ODEsep} and it describes the 1-parameter family of ($c$ is the parameter) integral curves of the ODE.

We now apply this procedure in a couple of concrete examples. Given an initial value problem (IVP), we will be concerned with 3 questions:

  • What is the general solution of the ODE given in the IVP?
  • What is the particular solution corresponding to the initial condition (IC) given in the IVP?
  • For what values of the independent variable $x$ does this particular solution exist?

A Detailed Example

Solve the initial value problem (IVP) $$ \frac{dy}{dx} = \frac{x^2}{1-y^2},~~~ y(0)=0. $$

First, observe that the ODE is separable:

$$ \frac{dy}{dx} = x^2\cdot\frac{1}{1-y^2}. $$

We can then write

$$ (1-y^2)\frac{dy}{dx} -x^2=0 $$

The first term on the left hand side is the derivative of $y(x) - \frac{y(x)^3}{3}$ with respect to $x$, that is:

$$ \frac{d}{dx}\left(y-\frac{y^3}{3}\right)=\frac{d}{dx}\left(y(x)-\frac{y(x)^3}{3}\right)= (1-y^2)\frac{dy}{dx} $$

by the Chain Rule, and

$$ x^2=\frac{d}{dx}\frac{x^3}{3}. $$

Thus we get that the ODE given in the problem can be expressed as:

\begin{equation}\label{eq:ex1deriv} \frac{d}{dx}\left(y(x) - \frac{y(x)^3}{3} - \frac{x^3}{3} \right) = 0. \end{equation}

Here in this first example we denoted the dependence of $y$ on $x$ in our notation. We will suppress this dependence in the coming examples. We integrate \eqref{eq:ex1deriv} and obtain

\begin{equation}\label{eq:ODEcurves} y - \frac{y^3}{3} - \frac{x^3}{3} = c, \end{equation}

for some arbitrary integration constant $c$. This can be rewritten as

\begin{equation}\label{eq:ex1sol} 3y - y^3 - x^3 = c. \end{equation}

The equation \eqref{eq:ex1sol} is an implicit equation and it defines the integral curves (1-parameter family of curves, with the parameter $c$) for the ODE given in this initial value problem. Note that any function $y=\varphi(x)$ which satisifies the relation \eqref{eq:ex1sol} also satisfies the ODE under consideration.

Now, (especially for students who took Math 116) it is also possible to express

$$ \frac{dy}{dx} = x^2\cdot\frac{1}{1-y^2}. $$

as

$$ (1-y^2)\,dy = x^2\,dx. $$

Then integrating both sides and combining the resulting integration constants into a single arbitrary constant $c$ gives

$$ y-\frac{y^3}{3} = \frac{x^3}{3} + c, $$

which is of course the same as \eqref{eq:ex1sol}. The reason we did not go through this calculation was to avoid doing algebra with the differentials $dy$ and $dx$ since we did not define them. These methods are not different. The process boils down to finding antiderivatives of $N(y)=1-y^2$ and $p(x)=x^2$ no matter how one proceeds.

See below a plot of these integral curves on the $(x,y)$-plane (for varying values of the constant $c$: see the color bar.)


In [1]:
using Plots
plotly()
import Gadfly
dark_panel = Gadfly.Theme(
    line_width=2.5pt,
    guide_title_position=:center
)
Gadfly.push_theme(dark_panel)
Gadfly.plot(z=(x,y) -> -x^3 - y^3 + 3*y,
     x=linspace(-5,5,150), y=linspace(-5,5,150), Gadfly.Geom.contour(levels=-50:5:50), Gadfly.Guide.title("Integral Curves"),Gadfly.Guide.colorkey("c"))


Out[1]:
x -20 -15 -10 -5 0 5 10 15 20 -15.0 -14.5 -14.0 -13.5 -13.0 -12.5 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 -20 -10 0 10 20 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 50 0 -50 c -20 -15 -10 -5 0 5 10 15 20 -15.0 -14.5 -14.0 -13.5 -13.0 -12.5 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 -20 -10 0 10 20 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 y Integral Curves

Now we use the IC $y(0)=0$ to pick a particular solution from this family. Note that if $x=0$ and $y=0$, then \eqref{eq:ex1sol} gives

$$ 3\cdot 0 - 0 - 0 = c \implies c=0 $$

Thus the solution $y(x)$ to this IVP is given implicitly by

\begin{equation}\label{eq:ODEpartcurve} 3y - y^3 - x^3 = 0. \end{equation}

See below for a plot of this particular solution. The initial condition is marked with an orange dot.


In [2]:
import Gadfly
t = -4:0.01:4
Gadfly.plot(Gadfly.layer(x=[0], y=[0], Gadfly.Geom.point, Gadfly.Theme(default_color=color(colorant"orange"),default_point_size=4pt)),Gadfly.layer(x= cbrt(3.*t - t.^3 ), y = t, Gadfly.Geom.path()),Gadfly.Guide.title("Particular solution for y(0)=0"))


Out[2]:
x -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 y Particular solution for y(0)=0

We cannot explicitly write down an expression for $y$ as a function $y=\varphi(x)$ of $x$. The solution exists on an interval of values of $x$, which contains the initial point $x=0$, as long as $\frac{dy}{dx}$ and $y$ both exist. We know that $\frac{dy}{dx}$ ceases to exist the moment the implicit curve \eqref{eq:ODEpartcurve} develops a vertical tangent line. The graph above indicates presence of two such points, which are marked purple below.


In [3]:
import Gadfly
t = -4:0.01:4
Gadfly.plot(Gadfly.layer(x=[0], y=[0], Gadfly.Geom.point, Gadfly.Theme(default_color=color(colorant"orange"),default_point_size=4pt)),Gadfly.layer(x=[-2^(1/3),2^(1/3)], y=[-1,1], Gadfly.Geom.point, Gadfly.Theme(default_color=color(colorant"purple"),default_point_size=4pt)),Gadfly.layer(x= cbrt(3.*t - t.^3 ), y = t, Gadfly.Geom.path()),Gadfly.Guide.title("Particular solution for y(0)=0"),Gadfly.layer( xintercept=[-2^(1/3), 2^(1/3)], Gadfly.Geom.vline(color=colorant"purple", size=1pt)))


Out[3]:
x -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 y Particular solution for y(0)=0

Although we cannot express $y$ as a function of $x$, we can still see from the ODE that $\frac{dy}{dx}$ does not exist if $y=\pm 1$ (the denominator is zero). We use the implicit equation \eqref{eq:ODEpartcurve} to find the $x$-coordinates of the points at which there are vertical tangents. It follows that these points are

$$ \left(-{2}^{1/3},-1\right)~\text{and}~({2}^{1/3},1) $$

Therefore particular solution we found exists on the interval $-{2}^{1/3} <x <{2}^{1/3}$.

Another Example

Solve the IVP \begin{equation}\label{eq:IVP2} \frac{dy}{dx} = 2(1+x)(1+y^2), ~y(0)=0, \end{equation} and find the point where the solution attains its minimum.

This ODE is clearly separable: $p(x) = 2(1+x)$ and $q(y) = 1+y^2$ in the notation we used above, and hence it can be written as

\begin{equation}\label{eq:ODE2} \frac{1}{1+y^2}\frac{dy}{dx} -2(1+x) = 0. \end{equation}

First observe that we can find an antiderivative (omitting the arbitrary constant, will add it at the end) of $\frac{1}{1+y^2}$ with respect to $y$:

$$ \frac{d}{dy} \arctan(y) =\frac{1}{1+y^2} $$

again, treating $y$ as a function $y(x)$ of $x$ and using Chain Rule we see that

$$ \frac{d}{dx}\arctan(y(x))= \frac{d}{dy}\arctan(y)\cdot \frac{dy}{dx} = \left(\frac{1}{1+y^2}\right)\frac{dy}{dx} $$

which is the first term in the ODE \eqref{eq:ODE2}. The second expression $2(1+x)$ has the antiderivative $2x+x^2$

$$ \frac{d}{dx}(2x+x^2) = 2(1+x). $$

These imply that the ODE \eqref{eq:ODE2} we have at our hands is equivalent to

\begin{equation}\label{eq:ODE2total} \frac{d}{dx}\left(\arctan(y) - 2x - x^2 \right) = 0. \end{equation}

This equation can now be directly integrated to get

\begin{equation}\label{eq:ODE2curve} \arctan(y) - 2x - x^2 = c, \end{equation}

where $c$ is an arbitrary constant. Below is a plot of the integral curves given by \eqref{eq:ODE2total}. We can clearly see that solutions develop vertical tangents somewhere in the interval $(-3,-2)$ and in the interval $(0,1)$. We will find those points.


In [4]:
using Plots
plotly()
import Gadfly
dark_panel = Gadfly.Theme(
    line_width=2.5pt,
    guide_title_position=:center
)
Gadfly.push_theme(dark_panel)
Gadfly.plot(z=(x,y) -> y - tan(x^2+2*x),
     x=linspace(-4,4,200), y=linspace(-20,20,500), Gadfly.Geom.contour(levels=-50:5:50), Gadfly.Guide.title("Integral Curves"),Gadfly.Guide.colorkey("c"))


Out[4]:
x -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 50 0 -50 c -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 -60 -58 -56 -54 -52 -50 -48 -46 -44 -42 -40 -38 -36 -34 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 -60 -30 0 30 60 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 y Integral Curves

First let's use the initial condition to pick a particular solution that satisfies the IVP. Plugging $x=0$ and $y=0$ to \eqref{eq:ODE2curve} gives $c=0$. Thus the particular solution is

$$ \arctan(y) -x^2-2x =0, $$

and explicitly:

$$ y = \tan(x^2+2x). $$

This solution exists as long as the value of $x^2+2x$ is away from $-\pi/2$ and $\pi/2$ (in which case the tangent function $\tan(\cdot)$ is undefined.) Note that

$$ x^2+2x > -1 > \frac{-\pi}{2}. $$

Therefore $x^2+2x \neq \frac{-\pi}{2}$ for all $x$. We now find when $x^2+2x$ equals $\frac{\pi}{2}$:

$$ x^2 + 2x = \frac{\pi}{2} $$

has 2 real solutions $x_1$ and $x_2$ given by:

\begin{align} x_1 &= \frac{1}{2}\left(-2 - \sqrt{4+2\pi}\right)\approx -2.6033 \\ x_2 &= \frac{1}{2}\left(-2 + \sqrt{4+2\pi}\right)\approx 0.6033. \end{align}

Clearly the initial value $x=0$ lies in the open interval $(-x_1,x_2)$. Therefore the solution $y=\varphi(x)=\tan(x^2+2x)$ which satisfies $\varphi(0)=0$ exists in the open interval $(-x_1,x_2)$ which is approximately $(-2.6033,0.6033)$. Below we see the plot of this solution where the initial data is marked orange.


In [5]:
import Gadfly
t = -2.59:0.0001:0.59
Gadfly.plot(Gadfly.layer(x=[0], y=[0], Gadfly.Geom.point, Gadfly.Theme(default_color=color(colorant"orange"),default_point_size=4pt)),Gadfly.layer(x= t, y = tan(t.^2+2*t), Gadfly.Geom.path()),Gadfly.Guide.title("Particular solution for y(0)=0"),Gadfly.layer( xintercept=[-2.6, 0.6], Gadfly.Geom.vline(color=colorant"purple", size=1pt)))


Out[5]:
x -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 -7.0 -6.8 -6.6 -6.4 -6.2 -6.0 -5.8 -5.6 -5.4 -5.2 -5.0 -4.8 -4.6 -4.4 -4.2 -4.0 -3.8 -3.6 -3.4 -3.2 -3.0 -2.8 -2.6 -2.4 -2.2 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 -10 -5 0 5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 -50 -48 -46 -44 -42 -40 -38 -36 -34 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 -50 0 50 100 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 y Particular solution for y(0)=0

We now find where the minimum of $\varphi(x)=\tan(x^2+2x)$ occurs on this interval. First note that $\varphi(x)$ is differentiable on its interval of existence and $x=-1$ is its only critical point: $\varphi'(-1)=0$. Second, direct differentiation shows that $\varphi''(x) >0$ on this interval. Therefore the solution $y=\varphi(x)$ attains its minimum at $x=-1$. Here is a close-up of this solution to illustrate the minimum (in green).


In [6]:
import Gadfly
t = -2:0.0001:0.5
Gadfly.plot(Gadfly.layer(x=[0], y=[0], Gadfly.Geom.point, Gadfly.Theme(default_color=color(colorant"orange"),default_point_size=4pt)),Gadfly.layer(x=[-1], y=[tan(-1)], Gadfly.Geom.point, Gadfly.Theme(default_color=color(colorant"green"),default_point_size=4pt)),Gadfly.layer(x= t, y = tan(t.^2+2*t), Gadfly.Geom.path()),Gadfly.Guide.title("Minimum of the particular solution"),Gadfly.layer( yintercept=[tan(-1)], Gadfly.Geom.hline(color=colorant"green", size=1pt)))


Out[6]:
x -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 -4.5 -4.4 -4.3 -4.2 -4.1 -4.0 -3.9 -3.8 -3.7 -3.6 -3.5 -3.4 -3.3 -3.2 -3.1 -3.0 -2.9 -2.8 -2.7 -2.6 -2.5 -2.4 -2.3 -2.2 -2.1 -2.0 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 -5 0 5 -4.6 -4.4 -4.2 -4.0 -3.8 -3.6 -3.4 -3.2 -3.0 -2.8 -2.6 -2.4 -2.2 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 -8.0 -7.8 -7.6 -7.4 -7.2 -7.0 -6.8 -6.6 -6.4 -6.2 -6.0 -5.8 -5.6 -5.4 -5.2 -5.0 -4.8 -4.6 -4.4 -4.2 -4.0 -3.8 -3.6 -3.4 -3.2 -3.0 -2.8 -2.6 -2.4 -2.2 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 -10 -5 0 5 10 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 y Minimum of the particular solution

In [ ]: