First-Order Differential Equations
First-Order, First-Degree Differential Equations
A differential equation relates an unknown function to one or more of its derivatives. A first-order, first-degree equation contains a first derivative, and that derivative appears only to the first power. The equation may still be nonlinear in the dependent variable: for instance, a term such as y2 does not make an equation higher than first degree, because the degree refers to the power of the derivative.
The main methods in this lesson are:
- recognizing and solving exact differential equations;
- turning some non-exact equations into exact ones with an integrating factor;
- solving linear differential equations;
- reducing certain nonlinear equations to linear ones, including Bernoulli equations.
The key to choosing a method is to look at the equation’s form and identify how its variables and derivatives are arranged.
Exact differential equations
An equation written as
M(x,y)dx+N(x,y)dy=0is called a differential form. Here, both M and N may depend on both x and y. The coefficient of dx is M, and the coefficient of dy is N.
What makes an equation exact?
An equation is exact when its left side is the total differential of some function F(x,y). In other words,
dF=Fxdx+Fydy,where Fx and Fy are the partial derivatives of F with respect to x and y. Therefore, the equation is exact when there is a function F satisfying
Fx=MandFy=N.If the relevant partial derivatives are continuous, the test for exactness is
∂y∂M=∂x∂N.This condition checks whether the two coefficients can consistently be partial derivatives of the same function. If they are equal, the original equation can be expressed as dF=0, and its solution is
F(x,y)=C,where C is a constant.
An exact equation is one whose entire left side is the differential of a single function.
How to solve an exact equation
A reliable method is to recover F in two stages.
-
Integrate M with respect to x, treating y as constant:
F(x,y)=∫M(x,y)dx+g(y).The term g(y) is included because any function depending only on y has derivative 0 with respect to x.
-
Differentiate this result with respect to y and set it equal to N:
Fy=N.This determines g(y).
-
Write the solution as F(x,y)=C.
The second step matters: integrating M with respect to x does not, by itself, determine any part of F that depends only on y.
Example: an exact equation
Consider
(ycosx+siny+y)dx+(sinx+xcosy+x)dy=0.Here,
M=ycosx+siny+y,N=sinx+xcosy+x.The exactness test gives
∂y∂M=cosx+cosy+1and
∂x∂N=cosx+cosy+1.The equation is exact. Integrate M with respect to x, treating y as constant:
F(x,y)=ysinx+xsiny+xy+g(y).Differentiating with respect to y gives
Fy=sinx+xcosy+x+g′(y).Comparing this with N shows that g′(y)=0, so g(y) can be absorbed into the constant C. The solution is
ysinx+xsiny+xy=C.Another exact-equation example
For
[y(1+x1)+cosy]dx+[x+ln∣x∣−xsiny]dy=0,the coefficients are
M=y(1+x1)+cosy,N=x+ln∣x∣−xsiny.Their cross-partials agree:
My=1+x1−siny,Nx=1+x1−siny.Integrating M with respect to x gives
F=y(x+ln∣x∣)+xcosy+g(y).Its derivative with respect to y matches N when g′(y)=0. Thus,
y(x+ln∣x∣)+xcosy=C.The absolute value in ln∣x∣ reflects that the expression is defined on intervals where x=0.
A product-rule example
In the equation
(y2exy2+4x3)dx+(2xyexy2−3y2)dy=0,the partial derivatives are equal:
My=2xy3exy2+2yexy2,Nx=2xy3exy2+2yexy2.Integrating M with respect to x gives
F=exy2+x4+g(y),because y is held constant during this integration. Differentiating with respect to y and matching with N gives g′(y)=−3y2, so g(y)=−y3. The solution is
exy2+x4−y3=C.Think About It: Why does integrating with respect to x require adding an unknown function of y, rather than only a numerical constant?
Non-exact equations and integrating factors
If
My=Nx,then the equation is non-exact in its current form. It may still be possible to multiply the entire equation by a suitable function so that the result becomes exact. Such a function is called an integrating factor.
If μ(x,y) is an integrating factor, then
μMdx+μNdy=0is exact. The method is:
- Check whether the original equation is exact.
- If it is not, use a suitable test to find an integrating factor.
- Multiply both coefficients by that factor.
- Solve the resulting exact equation.
Tests for useful integrating factors
For the equation Mdx+Ndy=0, the following tests are useful.
A factor depending only on x:
If
NMy−Nx=f(x),then an integrating factor is
μ(x)=e∫f(x)dx.A factor depending only on y:
If
MNx−My=g(y),then an integrating factor is
μ(y)=e∫g(y)dy.The first test is useful when the quotient simplifies to an expression involving only x. The second is useful when it simplifies to an expression involving only y.
A form involving xy:
If the coefficients can be written as
M=yf(xy),N=xg(xy),then a useful integrating factor is
μ=xM−yN1,provided the denominator is nonzero.
Homogeneous coefficients:
If M and N are homogeneous functions of the same degree, a useful integrating factor is
μ=xM+yN1,where the denominator is nonzero. A function is homogeneous of degree k if scaling both variables by a factor scales the function by the kth power of that factor. For a polynomial, this means all its terms have the same total degree.
These are tests for particular patterns, not a single universal rule. The useful factor is the one whose stated condition is satisfied.
Example: an integrating factor depending on x
Consider
(xy2−e1/x3)dx−x2ydy=0.Here,
My=2xy,Nx=−2xy.The equation is not exact. The quotient for the first test is
NMy−Nx=−x2y4xy=−x4,which depends only on x. Therefore,
μ(x)=e∫−4/xdx=x−4,on an interval where x=0.
After multiplication, the equation becomes
(x3y2−x4e1/x3)dx−x2ydy=0.It is now exact. Integrating the coefficient of dx with respect to x, treating y as constant, gives
F=−2x2y2+31e1/x3.For the exponential term, the substitution u=1/x3 gives du=−3x−4dx. The solution is
−2x2y2+31e1/x3=C.Example: an integrating factor involving both variables
Suppose the coefficients have the structure
M=y(x2y2+2),N=x(2−2x2y2).This matches the pattern M=yf(xy) and N=xg(xy), since the expressions inside the parentheses depend on x2y2=(xy)2. The corresponding factor is
μ=xM−yN1.Here,
xM−yN=3x3y3,so
μ=3x3y31.Multiplying by this factor produces an exact equation. Recovering its potential function gives the solution
31ln∣x∣+3y21−32ln∣y∣=C,on intervals where the logarithms and the integrating factor are defined.
Example: homogeneous coefficients
For
(x4+y4)dx−xy3dy=0,both coefficients are homogeneous of degree 4. The homogeneous-coefficient test gives
μ=xM+yN1=x(x4+y4)+y(−xy3)1=x51.After multiplication, the equation is exact:
(x1+x5y4)dx−x4y3dy=0.Integrating the coefficient of dx with respect to x gives a potential function
F=ln∣x∣−4x4y4.Therefore,
ln∣x∣−4x4y4=C.Think About It: What should be checked after multiplying a non-exact equation by a proposed integrating factor?
Linear differential equations
A first-order linear equation can be arranged as
dxdy+P(x)y=Q(x),where P and Q depend only on the independent variable x. It is linear in y because y and its derivative appear only to the first power, without products such as ydy/dx.
The integrating factor for this linear equation is
μ(x)=e∫P(x)dx.Multiplying the equation by μ turns its left side into a product derivative:
μdxdy+μPy=dxd(μy).That identity follows because μ′=μP. The equation can therefore be integrated in one step:
μy=∫μQdx+C.The dependent variable is always the one multiplied by the integrating factor on the left.
Example
Consider
dxdy+x2+14xy=x2+11.Here,
P(x)=x2+14x.The integrating factor is
μ=e∫x2+14xdx=e2ln(x2+1)=(x2+1)2.Thus,
y(x2+1)2=∫x2+11(x2+1)2dx+C=∫(x2+1)dx+C.Therefore,
y(x2+1)2=3x3+x+C.A second orientation works the same way. If x is dependent on y, the equation can be written as
dydx+P(y)x=Q(y).Its integrating factor is
μ(y)=e∫P(y)dy,and its solution is
μx=∫μQdy+C.The independent variable determines the variable of integration.
Equations reducible to linear form
Some equations are not linear at first, but a substitution can make them linear. The central idea is to spot a function and its derivative appearing together.
Substitution of a function of the dependent variable
Suppose an equation has the form
F′(y)dxdy+P(x)F(y)=Q(x).Set
t=F(y).By the chain rule,
dxdt=F′(y)dxdy.The equation becomes
dxdt+P(x)t=Q(x),which is linear in t.
For example, consider
ydxdy−3xy2=−34x.Since the derivative of y2 contains ydy/dx, set t=y2. Then
dxdt=2ydxdy.Replacing ydy/dx by 21dt/dx and y2 by t gives
dxdt−3x2t=−38x.This is linear in t. Its integrating factor is
μ=e∫−2/(3x)dx=x−2/3,on an interval where x=0. Hence,
tx−2/3=∫−38xx−2/3dx+C=−2x4/3+C.Since t=y2, the result is
y2x−2/3=−2x4/3+C.Substitution when the dependent variable is x
A corresponding pattern can occur when x is dependent on y:
F′(x)dydx+P(y)F(x)=Q(y).Setting t=F(x) gives
dydt=F′(x)dydx,so the equation becomes
dydt+P(y)t=Q(y).It is then solved as a linear equation in t, with y as the independent variable. This method depends on recognizing that both F(x) and the derivative term associated with it occur in the equation.
Think About It: When a nonlinear equation contains a product such as ydy/dx, what familiar derivative might that suggest?
Bernoulli differential equations
A Bernoulli equation has the form
dxdy+P(x)y=Q(x)yn,where n is a constant. For n=0 and n=1, the equation is generally nonlinear in y, but a power substitution converts it to a linear equation.
Divide by yn:
y−ndxdy+P(x)y1−n=Q(x).Now set
t=y1−n.Differentiating gives
dxdt=(1−n)y−ndxdy.Substituting into the divided equation and multiplying by 1−n produces
dxdt+(1−n)P(x)t=(1−n)Q(x).This is linear in t. Once it is solved, the substitution t=y1−n is reversed.
Example
Consider
dθdr=rtanθ−r2secθ.Rearrange it into Bernoulli form:
dθdr−rtanθ=−r2secθ.The dependent variable r appears once to the first power and once to the second power, so n=2. Divide by r2:
r21dθdr−rtanθ=−secθ.Set
t=−r1.Then
dθdt=r21dθdr.Also, 1/r=−t, so the equation becomes
dθdt+ttanθ=−secθ.This is linear in t. Its integrating factor is
μ=e∫tanθdθ=secθ.Multiplication by secθ gives
dθd(tsecθ)=−sec2θ.Integrating and then restoring t=−1/r yields
−rsecθ=−tanθ+C.Comprehensive review
A first-order, first-degree differential equation can take several forms, so solving begins with recognition rather than integration.
- For Mdx+Ndy=0, test exactness by comparing My and Nx. If they agree, recover a potential function F and write F=C.
- If the equation is not exact, check whether one of the integrating-factor tests applies. Multiply the entire equation by that factor, then solve the exact equation.
- For a linear equation, identify the dependent variable and the independent variable. Use the factor e∫Pdx when the equation is written in terms of y and x, or e∫Pdy when it is written in terms of x and y.
- If a function and its derivative appear together, a substitution such as t=F(y) or t=F(x) may reduce the equation to linear form.
- If the dependent variable appears both linearly and as a fixed power, test whether the equation is Bernoulli and use t=y1−n.
Across all these methods, the same ideas recur: identify the structure, choose a substitution or integrating factor that simplifies it, and keep track of which variable is dependent so differentiation and integration are performed with respect to the correct independent variable.

Ask anything
We've read this whole study set, so questions about it get the best answers.