How to solve first order linear differential equation

A first order differential equation is an ordinary differential equation (ODE) that involves only the first derivatives of an unknown function with respect to a single independent variable.

Mathematically, first order ODE is represented as:

For example:

Solving first order ODE

Suppose we have the following ODE to solve:

Bring it in the dxdy+P(x)y=Q(x)\frac{dx}{dy} + P(x)y = Q(x) form:

Substitute dxdy=udvdx+vdudx and y=uv\frac{dx}{dy} = u\frac{dv}{dx} + v\frac{du}{dx} \textnormal{ and } y=uv in the equation above:

Assume vv equals zero:

Separate the variables:

Integrating on both sides:

You can put the constant cc on either side of the equation.

Change cc to ln(k)ln(k), where kk is another constant as cc is.

Put uu in Eq (1):

Since we assumed vv equals zero, the above equation will become:

Integrating on both sides:

where dd is a constant. You can put the constant on either side of the equation. Put uu and vv in y=uvy=uv:

Since both dd and kk are constants, we can replace them with a single letter CC:

Test yourself

Q

What is the solution(s) for the differential equation dydx=x3yx\frac{dy}{dx} = x-\frac{3y}{x}?

Note: Assume that the final constant will be \\ \textnormal{Note: Assume that the final constant will be } cc

A)

y=cx3x2y = cx^3 − x^2

B)

y=x3cx2y = x^3 − cx^2

C)

y=x2cx3y = x^2 − cx^3

D)

y=cx2x3y = cx^2 − x^3

Note: Learn about how to solve second order linear differential equations.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved