Type a command or search the notes. Tab cycles completions. Up and down recall history when blank. Escape dismisses, then leaves the prompt.
MATH
[1251]

First-order methods

Separable, linear, exact and transformable first-order ODE methods.

This page solves first-order equations by recognising a structure that can be integrated directly: separable, linear or exact. Substitutions handle equations that reduce to one of these three.

The three tests are independent rather than mutually exclusive, so one equation can pass more than one. The method-selection workflow gives the order in which to try them and the equations produced in modelling with first-order equations need the same check.

Separable equations

[DEFINITION]

Separable equation

A first-order ODE is separable when it can be written as

dydx=f(x)g(y).\frac{dy}{dx}=f(x)g(y).

On an interval where g(y)≠0g(y)\neq0, the variables can be placed on opposite sides. Zeros of gg must be checked before division because they may give constant solutions that the separated calculation does not contain.

[METHOD]

Separation of variables

To solve dydx=f(x)g(y)\frac{dy}{dx}=f(x)g(y) on a branch where g(y)≠0g(y)\neq0:

  1. Write dyg(y)=f(x) dx\frac{dy}{g(y)}=f(x)\,dx.
  2. Integrate both sides: ∫dyg(y)=∫f(x) dx+C.\int\frac{dy}{g(y)}=\int f(x)\,dx+C.
  3. Apply initial or boundary data and state the interval or branch on which the result is valid.
  4. Check separately any constant solutions arising from g(y)=0g(y)=0.

The result is often implicit. Taking logarithms can hide a sign choice and the initial data select the branch, subject to the hypotheses in existence, uniqueness and linear operators.

[EXAMPLE]

Exponential growth with an initial value

For

y′=y(x+3x2),y(0)=1,y'=y(x+3x^2),\qquad y(0)=1,

the initial value is nonzero, so separate on the branch y≠0y\neq0:

dyy=(x+3x2) dx.\frac{dy}{y}=(x+3x^2)\,dx.

Therefore

ln⁡∣y∣=x22+x3+C.\ln|y|=\frac{x^2}{2}+x^3+C.

Since y(0)=1>0y(0)=1>0, the positive branch is selected and the constant is zero:

y=ex2/2+x3.y=e^{x^2/2+x^3}.
[EXAMPLE]

A lost equilibrium and a real-domain restriction

For

y′=x1−y2,y'=x\sqrt{1-y^2},

the nonconstant solutions on a real branch satisfy

dy1−y2=x dx.\frac{dy}{\sqrt{1-y^2}}=x\,dx.

Integration gives

arcsin⁡y=x22+C.\arcsin y=\frac{x^2}{2}+C.

The square root requires ∣y∣≤1|y|\leq1. Because arcsin⁡y\arcsin y takes values in [−π/2,π/2][-\pi/2,\pi/2], the implicit relation describes a branch only while x2/2+Cx^2/2+C stays in that range.

The constant solutions y=1y=1 and y=−1y=-1 were lost on division. At a point where a nonconstant branch reaches either level, it can also join a constant branch: the right side is zero there and uniqueness is not guaranteed at ∣y∣=1|y|=1.

[EXAMPLE]

A family of circles

For

dydx=−xy,\frac{dy}{dx}=-\frac{x}{y},

multiply by y dxy\,dx and integrate:

y dy=−x dx⟹x22+y22=C.y\,dy=-x\,dx \quad\Longrightarrow\quad \frac{x^2}{2}+\frac{y^2}{2}=C.

After absorbing the factor of 22 into the constant,

x2+y2=C.x^2+y^2=C.

The solution curves are circles, but the original differential equation is undefined when y=0y=0. Thus a circle is represented by an upper or lower graph branch on an interval that does not cross its points on the xx-axis. The initial points (0,7)(0,7), (2,3)(2,3) and (−6,−8)(-6,-8) select respectively

x2+y2=49,x2+y2=13,x2+y2=100.x^2+y^2=49,\qquad x^2+y^2=13,\qquad x^2+y^2=100.

First-order linear equations

When the variables cannot be separated, test next whether the equation is linear in yy. Mixing and cooling laws in modelling with first-order equations lead to this case.

[DEFINITION]

First-order linear equation

A first-order linear ODE in normal form is

y′+p(x)y=q(x).y'+p(x)y=q(x).

The term p(x)yp(x)y couples yy to y′y', so direct integration of y′y' and q(x)q(x) separately does not solve the equation. An integrating factor makes the left side a product-rule derivative.

[METHOD]

Integrating factor

For y′+p(x)y=q(x)y'+p(x)y=q(x) on an interval where pp and qq are continuous:

  1. Choose μ(x)=e∫p(x) dx.\mu(x)=e^{\int p(x)\,dx}.
  2. Since μ′=pμ\mu'=p\mu, multiply the equation by μ\mu: μy′+μpy=(μy)′=μq.\mu y'+\mu p y=(\mu y)'=\mu q.
  3. Integrate: μy=∫μq dx+C.\mu y=\int\mu q\,dx+C.
  4. Divide by μ\mu: y=1μ(∫μq dx+C).y=\frac1{\mu}\left(\int\mu q\,dx+C\right).

The integrating factor is not a new solution of the ODE; it is chosen to produce the product rule. If the coefficient of y′y' is not 11, first divide by it on an interval where it is nonzero.

[EXAMPLE]

An equation already in product-rule form

For

ex2y′+2xex2y=x,e^{x^2}y'+2xe^{x^2}y=x,

the left side is already (ex2y)′(e^{x^2}y)'. Hence

(ex2y)′=x⟹ex2y=x22+C,(e^{x^2}y)'=x \quad\Longrightarrow\quad e^{x^2}y=\frac{x^2}{2}+C,

and

y=e−x2(x22+C).y=e^{-x^2}\left(\frac{x^2}{2}+C\right).

[routine]

  1. [1]:Integrating factor
[EXAMPLE]

A standard first-order linear equation

For

y′+3y=e−x,y'+3y=e^{-x},

the integrating factor is μ=e3x\mu=e^{3x}. Multiplication gives

(e3xy)′=e2x.(e^{3x}y)'=e^{2x}.

Therefore

e3xy=12e2x+C,e^{3x}y=\frac12e^{2x}+C,

so

y=12e−x+Ce−3x.y=\frac12e^{-x}+Ce^{-3x}.

[routine]

  1. [1]:Integrating factor
[EXAMPLE]

A singular normal form with a smooth continuation

For

xy′+(x+1)y=2,xy'+(x+1)y=2,

divide by xx only on x>0x>0 or x<0x<0:

y′+(1+1x)y=2x.y'+\left(1+\frac1x\right)y=\frac2x.

On either interval, an integrating factor is

μ(x)=ex+ln⁡∣x∣.\mu(x)=e^{x+\ln|x|}.

Multiplying by a nonzero constant does not change an integrating factor, so we may take μ=xex\mu=xe^x on each chosen interval. Then

(xexy)′=2ex,xexy=2ex+C.(xe^xy)'=2e^x, \qquad xe^xy=2e^x+C.

Thus

y=2x+Ce−xx.y=\frac2x+\frac{Ce^{-x}}{x}.

The normalised equation is valid only for x≠0x\ne0, but the original equation at x=0x=0 still imposes y(0)=2y(0)=2. Choosing C=−2C=-2 gives

y=2(1−e−x)x,y(0)=2y=\frac{2(1-e^{-x})}{x}, \qquad y(0)=2

by continuous extension. Other values of CC do not extend continuously through x=0x=0, so the interval restriction created by division must still be reported.

Exact equations

When the equation is neither separable nor linear, test whether M dx+N dy=0M\,dx+N\,dy=0 is a total differential. If the test fails, try a substitution or a numerical method.

[DEFINITION]

Exact differential equation

An equation in differential form

M(x,y) dx+N(x,y) dy=0M(x,y)\,dx+N(x,y)\,dy=0

is exact on a domain when there is a potential function F(x,y)F(x,y) such that

Fx=M,Fy=N.F_x=M,\qquad F_y=N.

Here FxF_x means differentiate with respect to xx while holding yy fixed, and FyF_y means differentiate with respect to yy while holding xx fixed. The later multivariable-calculus chapter develops this notation and the level-curve geometry in more detail.

Along a curve y=y(x)y=y(x), the differential equation becomes

M(x,y)+N(x,y)y′=0.M(x,y)+N(x,y)y'=0.

A potential turns this into the statement that FF is constant along the curve, as shown after the theorem below.

[THEOREM]

The exactness test and potential

Suppose MM and NN have continuous first partial derivatives on an open simply connected domain DD. If

My=∂M∂y=Nx=∂N∂xM_y=\frac{\partial M}{\partial y} =N_x=\frac{\partial N}{\partial x}

throughout DD, then the equation M dx+N dy=0M\,dx+N\,dy=0 has a potential FF on DD and its solution curves satisfy

F(x,y)=C.F(x,y)=C.

Matching partial derivatives guarantees a single-valued potential on a simply connected domain, while holes in the domain can obstruct a global potential.

One direction is short. If a potential FF exists and M,NM,N have continuous first partial derivatives, then equality of mixed partials gives

My=Fxy=Fyx=Nx,M_y=F_{xy}=F_{yx}=N_x,

so My=NxM_y=N_x is necessary. The converse is the substantive part of the theorem: the simply connected hypothesis rules out holes that can prevent locally compatible derivatives from coming from one global potential. The course uses the theorem as a test rather than developing the line-integral theory behind that global step.

In practice, the construction below produces a candidate FF directly and checking Fx=MF_x=M and Fy=NF_y=N verifies it without that further theory. Once a potential is known, along a solution curve the chain rule gives

ddxF(x,y(x))=Fx+Fyy′=M+Ny′=0.\frac{d}{dx}F(x,y(x)) =F_x+F_y y' =M+Ny' =0.

Therefore FF is constant along each solution curve, so the curves are level curves F(x,y)=CF(x,y)=C. This explains why a potential solves the ODE, not why one exists.

Level curves connect exact equations to gradients. In two variables, the gradient is the vector of partial derivatives, ∇F=(Fx,Fy)\nabla F=(F_x,F_y). At a regular point of a level curve F=CF=C (where this vector is nonzero), it is normal to the curve. Since (Fx,Fy)=(M,N)(F_x,F_y)=(M,N), the equation M+Ny′=0M+Ny'=0 says that the graph's tangent direction (1,y′)(1,y') is perpendicular to the gradient. An exact equation is therefore a level-curve problem whose slope field is orthogonal to the gradient. Points where ∇F=0\nabla F=0 need separate attention. The multivariable-calculus chapter develops this geometry further.

[METHOD]

Constructing the potential

To solve an exact equation:

  1. Check that My=NxM_y=N_x on the domain.
  2. Integrate MM with respect to xx, treating yy as constant: F(x,y)=∫M(x,y) dx+h(y).F(x,y)=\int M(x,y)\,dx+h(y).
  3. Differentiate this expression with respect to yy.
  4. Match FyF_y with NN to determine h(y)h(y).
  5. Write the implicit solution as F(x,y)=CF(x,y)=C.

The arbitrary function h(y)h(y) is needed because integration with respect to xx leaves every function of yy unchanged. Omitting it can make the final expression fail to reproduce NN.

[EXAMPLE]

A polynomial potential

For

(2x+y+3) dx+(2y+x−7) dy=0,(2x+y+3)\,dx+(2y+x-7)\,dy=0,

we have

My=1=Nx,M_y=1=N_x,

so the equation is exact. Integrate MM with respect to xx:

F=x2+xy+3x+h(y).F=x^2+xy+3x+h(y).

Then

Fy=x+h′(y)=x+2y−7,F_y=x+h'(y)=x+2y-7,

which gives h′(y)=2y−7h'(y)=2y-7 and hence h(y)=y2−7yh(y)=y^2-7y. The implicit general solution is

x2+xy+3x+y2−7y=C.x^2+xy+3x+y^2-7y=C.
[EXAMPLE]

A potential involving hyperbolic functions

Rewrite

(x2y+y3)y′+xy2+sinh⁡(2x)=0(x^2y+y^3)y'+xy^2+\sinh(2x)=0

as

(xy2+sinh⁡(2x)) dx+(x2y+y3) dy=0.\bigl(xy^2+\sinh(2x)\bigr)\,dx +\bigl(x^2y+y^3\bigr)\,dy=0.

Here

My=2xy=Nx.M_y=2xy=N_x.

Integrating MM with respect to xx gives

F=12x2y2+12cosh⁡(2x)+h(y).F=\frac12x^2y^2+\frac12\cosh(2x)+h(y).

Matching

Fy=x2y+h′(y)=x2y+y3F_y=x^2y+h'(y)=x^2y+y^3

gives h(y)=y4/4h(y)=y^4/4. Therefore

12x2y2+12cosh⁡(2x)+14y4=C.\frac12x^2y^2+\frac12\cosh(2x)+\frac14y^4=C.

If the partial derivatives do not match, the equation is not exact in its current form. It may still be solvable by separation, a substitution or an integrating factor, but the exact method needs the equation to be changed first.

Homogeneous substitutions

When none of these structures is visible, a change of variables may reveal one. A degree-zero ratio y/xy/x calls for y=xvy=xv and a power yny^n calls for the Bernoulli substitution below. Either way, the substitution turns the equation into an earlier case rather than starting a new family.

[DEFINITION]

Homogeneous function

A function F(x,y)F(x,y) is homogeneous of degree kk when

F(λx,λy)=λkF(x,y)F(\lambda x,\lambda y)=\lambda^kF(x,y)

for nonzero scalars λ\lambda wherever both sides are defined.

When the right side of y′=F(x,y)y'=F(x,y) is homogeneous of degree 00, scaling (x,y)(x,y) leaves it unchanged. On a suitable domain, it can therefore be expressed as a function of y/xy/x, which suggests the substitution y=xvy=xv.

[METHOD]

The substitution y=xvy=xv

For an equation of the form

dydx=f(yx),\frac{dy}{dx}=f\left(\frac{y}{x}\right),

set y=xv(x)y=xv(x). Then

y′=v+xv′,y'=v+xv',

so

xv′=f(v)−v,dvdx=f(v)−vx.xv'=f(v)-v, \qquad \frac{dv}{dx}=\frac{f(v)-v}{x}.

The resulting equation is separable on an interval where x≠0x\neq0 and the required denominators are nonzero.

The substitution works because y/xy/x becomes vv. The point x=0x=0 is excluded from the interval used for the substitution unless the original equation is analysed separately there.

[EXAMPLE]

A degree-zero right side

For

2xy y′+x2+y2=0,2xy\,y'+x^2+y^2=0,

solve for the derivative:

y′=−x2+y22xy.y'=-\frac{x^2+y^2}{2xy}.

The right side is homogeneous of degree 00. Work on an interval where x≠0x\ne0 and y≠0y\ne0, so the displayed normal form and the substitution v=y/xv=y/x are valid. Put y=xvy=xv, so y′=v+xv′y'=v+xv'. Substitution gives

2x(xv)(v+xv′)+x2+x2v2=0,2x(xv)(v+xv')+x^2+x^2v^2=0,

and, after division by x2x^2,

2xvv′+1+3v2=0.2xvv'+1+3v^2=0.

Separate and integrate:

2v1+3v2 dv=−dxx⟹13ln⁡(1+3v2)=−ln⁡∣x∣+C.\frac{2v}{1+3v^2}\,dv=-\frac{dx}{x} \quad\Longrightarrow\quad \frac13\ln(1+3v^2)=-\ln|x|+C.

Exponentiating gives (1+3v2)∣x∣3=C1(1+3v^2)|x|^3=C_1. The sign of xx is fixed on the chosen interval, so that sign can be absorbed into the constant. Substituting v=y/xv=y/x gives the equivalent implicit solution

x3+3xy2=Cx^3+3xy^2=C

on a chosen interval with x≠0x\neq0 and y≠0y\neq0. Differentiating this relation gives

3x2+3y2+6xy y′=0,3x^2+3y^2+6xy\,y'=0,

which is equivalent to the original equation.

Bernoulli equations

The substitution y=xvy=xv uses scaling in both variables. A Bernoulli substitution instead changes the dependent variable so that a nonlinear power becomes a first-order linear equation.

[DEFINITION]

Bernoulli equation

A Bernoulli equation has the form

y′+p(x)y=q(x)yn,n≠0,1.y'+p(x)y=q(x)y^n, \qquad n\neq0,1.

The cases n=0n=0 and n=1n=1 are already first-order linear equations. For n≠0,1n\neq0,1, the nonlinear power can be converted into a new dependent variable on a real branch where the required powers of yy are defined.

[METHOD]

The Bernoulli substitution

For a Bernoulli equation, on a nonzero real branch where y1−ny^{1-n} is defined, set

v=y1−n.v=y^{1-n}.

Since

v′=(1−n)y−ny′,v'=(1-n)y^{-n}y',

multiplying the equation by (1−n)y−n(1-n)y^{-n} gives the linear equation

v′+(1−n)p(x)v=(1−n)q(x).v'+(1-n)p(x)v=(1-n)q(x).

Solve this equation with an integrating factor, then substitute back. Check y=0y=0 separately because the substitution divides by a power of yy; it is an admissible solution only when the original equation is defined there and both sides agree.

[EXAMPLE]

A Bernoulli equation with a zero solution

For

2xy′−y=10x3y5,2xy'-y=10x^3y^5,

use v=y−4v=y^{-4} on a nonzero branch. Since v′=−4y−5y′v'=-4y^{-5}y', multiplying by y−5y^{-5} and rearranging gives

v′+2xv=−20x2.v'+\frac2xv=-20x^2.

The integrating factor is x2x^2, so

(x2v)′=−20x4⟹x2v=−4x5+C.(x^2v)'=-20x^4 \quad\Longrightarrow\quad x^2v=-4x^5+C.

Thus

y−4=v=−4x3+Cx2,y^{-4}=v=-4x^3+\frac{C}{x^2},

or, on intervals where the right side gives a real nonzero solution,

y=±(−4x3+Cx2)−1/4.y=\pm\left(-4x^3+\frac{C}{x^2}\right)^{-1/4}.

These real branches require x≠0x\neq0 and −4x3+C/x2>0-4x^3+C/x^2>0. The solution y=0y=0 is also present in the original equation but is not represented by y−4y^{-4}.

On this page