First-Order ODE Solver Calculator

Published on: July 18, 2026
Final Answer: Free | Full Steps: Pro

This First Order ODE Solver Calculator finds the general solution of an equation that links y to its first derivative, and shows the working line by line. The type of equation is identified first, because a separable equation, a linear one and an exact one are each undone by a different move. Integrating then introduces the arbitrary constant that every general solution carries. Following the same pattern every time makes the choice of method visible rather than guessed.

Step-by-step method

  1. Set up the problem.
  2. Identify the type of equation.
  3. Rearrange the equation.
  4. Work out what to integrate.
  5. Integrate.
  6. Solve for y.

Formula: Separable and Linear Equations

A separable equation is split into a y side and an x side and both are integrated. A linear equation is multiplied by the integrating factor μ so the left side becomes the derivative of μy.

\(\frac{dy}{dx} = g(x)h(y) \;\Rightarrow\; \int \frac{dy}{h(y)} = \int g(x)\,dx,\qquad y' + P(x)y = Q(x) \;\Rightarrow\; \mu = e^{\int P\,dx}\)

Useful Tips to Remember

Always check first whether the right side splits into a part with only x times a part with only y, because separating is the quickest method. Write a linear equation in the form \(y' + P(x)y = Q(x)\) before finding \(\mu\), since P must be the coefficient of y when y' has coefficient 1. Add the constant C as soon as you integrate, not at the end. In an exact equation the test \(M_{y} = N_{x}\) must hold, otherwise another method is needed.

Required knowledge

Where Are First Order Differential Equations Used?

First-order equations describe anything whose rate of change depends on its current value. Population growth, radioactive decay and compound interest all follow \(y' = ky\). Newton's law of cooling, the charge on a capacitor in an RC circuit and the speed of a falling object with air resistance are linear first-order equations. Chemists use them for reaction rates, and doctors use them to model how a drug leaves the body.

  • Population growth and radioactive decay
  • Newton's law of cooling
  • Charging and discharging capacitors
  • Mixing problems with tanks of liquid
  • Drug concentration in the bloodstream

First Order ODE Practice Problems

Example 1 solves the separable equation \(y' = xy\), and Example 2 solves the linear equation \(y' + y = x\) with an integrating factor. Decide the type first, then follow its method. For two more free worked examples, check out the First-Order ODE Solver Notes.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(y' = x y\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Identify the type of equation.
  3. Rearrange the equation.
  4. Work out what to integrate.
  5. Integrate.
  6. Solve for y.

Formula

Formula: Separable and Linear Equations

A separable equation is split into a y side and an x side and both are integrated. A linear equation is multiplied by the integrating factor μ so the left side becomes the derivative of μy.

\(\frac{dy}{dx} = g(x)h(y) \;\Rightarrow\; \int \frac{dy}{h(y)} = \int g(x)\,dx,\qquad y' + P(x)y = Q(x) \;\Rightarrow\; \mu = e^{\int P\,dx}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are solving the first-order differential equation \(y' = x y\), which means finding every function \(y(x)\) that makes it true.

\(y' = x y\)

Step 2

Step 2 - Identify the type of equation.

In this problem: The right side splits into a part with only \(x\) and a part with only \(y\), so the equation is separable. All the \(y\) terms go with \(dy\) and all the \(x\) terms go with \(dx\), then both sides are integrated.

\(\frac{dy}{dx} = g(x)h(y) \;\Rightarrow\; \int \frac{dy}{h(y)} = \int g(x)\,dx\)

Step 3

Step 3 - Separate the variables.

In this problem: Writing \(y'\) as \(\frac{dy}{dx}\), the right side is \(x \cdot y\). Dividing by \(y\) and multiplying by \(dx\) separates the variables.

\(\frac{dy}{dx} = x y \;\Rightarrow\; \frac{1}{y}\,dy = x\,dx\)

Step 4

Step 4 - Set up the integrals.

In this problem: Both sides are integrated, one with respect to \(y\) and the other with respect to \(x\).

\(\int \frac{1}{y}\,dy = \int x\,dx\)

Step 4a

Step 4a - Integrate the y side.

In this problem: Integrating \(\frac{1}{y}\) with respect to \(y\), covered in the Reciprocal Rule Integration Calculator, gives \(\ln|y|\).

\(\int \frac{1}{y}\,dy = \ln|y|\)

Step 4b

Step 4b - Integrate the x side.

In this problem: Integrating \(x\) with respect to \(x\), covered in the Power Rule Integration Calculator, gives \(\frac{x^{2}}{2}\).

\(\int x\,dx = \frac{x^{2}}{2}\)

Step 5

Step 5 - Integrate.

In this problem: Putting the two sides together and adding one constant \(C\) gives \(\ln|y| = \frac{x^{2}}{2} + C\).

\(\ln|y| = \frac{x^{2}}{2} + C\)

Step 6

Step 6 - Solve for y.

In this problem: Raising \(e\) to the power of both sides removes the \(\ln\). The number \(\pm e^{C}\), together with any number multiplying it, is just another constant, so it is written as \(C\) again. This gives \(y = C e^{\frac{x^{2}}{2}}\).

\(\ln|y| = \frac{x^{2}}{2} + C \;\Rightarrow\; y = C e^{\frac{x^{2}}{2}}\)

Final Answer

\(y = C e^{\frac{x^{2}}{2}}\)
See Example 2 Hide Example 2

Problem

\(y' + y = x\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Identify the type of equation.
  3. Rearrange the equation.
  4. Work out what to integrate.
  5. Integrate.
  6. Solve for y.

Formula

Formula: Separable and Linear Equations

A separable equation is split into a y side and an x side and both are integrated. A linear equation is multiplied by the integrating factor μ so the left side becomes the derivative of μy.

\(\frac{dy}{dx} = g(x)h(y) \;\Rightarrow\; \int \frac{dy}{h(y)} = \int g(x)\,dx,\qquad y' + P(x)y = Q(x) \;\Rightarrow\; \mu = e^{\int P\,dx}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are solving the first-order differential equation \(y' + y = x\), which means finding every function \(y(x)\) that makes it true.

\(y' + y = x\)

Step 2

Step 2 - Identify the type of equation.

In this problem: The equation only has \(y\) and \(y'\) to the first power, so it is linear. It is solved by multiplying by an integrating factor \(\mu\), which turns the left side into the derivative of \(\mu y\).

\(y' + P(x)y = Q(x) \;\Rightarrow\; \mu = e^{\int P\,dx},\quad \mu y = \int \mu Q\,dx\)

Step 3

Step 3 - Write the standard form.

In this problem: The equation is already in the standard form \(y' + y = x\), so \(P(x) = 1\) and \(Q(x) = x\).

\(y' + y = x\)

Step 4

Step 4 - Find the integrating factor.

In this problem: Integrating \(P(x) = 1\), covered in the Constant Rule Integration Calculator, gives \(x\), so the integrating factor is \(\mu = e^{x}\).

\(\mu = e^{\int 1\,dx} = e^{x}\)

Step 5

Step 5 - Multiply by the integrating factor.

In this problem: Multiplying every term by \(e^{x}\) makes the left side \(\left(e^{x} y\right)'\) by the product rule, so the equation becomes \(\left(e^{x} y\right)' = x e^{x}\).

\(\left(e^{x} y\right)' = x e^{x}\)

Step 6

Step 6 - Integrate both sides.

In this problem: Integrating both sides, covered in the Integration by Parts Calculator, gives \(e^{x} y = \left(x - 1\right) e^{x} + C\).

\(e^{x} y = \int x e^{x}\,dx = \left(x - 1\right) e^{x} + C\)

Step 7

Step 7 - Solve for y.

In this problem: Dividing both sides by \(e^{x}\) gives \(y = C e^{- x} + x - 1\).

\(y = C e^{- x} + x - 1\)

Final Answer

\(y = C e^{- x} + x - 1\)

Notes and Practice Mode

Example Problems

Click one to load it into the box and solve it.