First-Order ODE Solver Notes
These First-Order ODE Solver Notes explain how to find the general solution of an equation that links y to its first derivative, with the working shown 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
- Set up the problem.
- Identify the type of equation.
- Rearrange the equation.
- Work out what to integrate.
- Integrate.
- 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.
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
- How to integrate each side, covered in the Indefinite Integral Calculator.
- How to differentiate the parts of an exact equation, covered in the Partial Derivatives Calculator.
- How to differentiate a product, covered in the Derivative Calculator.
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. Examples 3 and 4 give you two more of the same kind to try, \(y' = 2 y\) and \(y' + 2 y = 4\). Decide the type first, then follow its method.
The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. Try each problem on paper first, then open the example and check your working one step at a time, so you can see exactly which step went wrong if your answer does not match. Use them to check your answers and to understand why each step works.
See Example 1 Hide Example 1
Problem
Approach
Step-by-step method
- Set up the problem.
- Identify the type of equation.
- Rearrange the equation.
- Work out what to integrate.
- Integrate.
- 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.
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.
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.
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.
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\).
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|\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the reciprocal rule for integration.
- Apply the reciprocal rule and add C.
Step 1
Step 1 - Set up the problem.
In this problem: The function is \(\frac{1}{y}\).
Step 2
Step 2 - Write the reciprocal rule for integration.
In this problem: The integral of one over x is the natural logarithm of the absolute value of x. This is the special case the power rule cannot handle.
Step 3
Step 3 - Apply the reciprocal rule and add C.
In this problem: Put \(\frac{1}{y}\) into the rule from Step 2.
Final Answer
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}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule for integration.
- Substitute the exponent into the formula.
- Solve and simplify, adding C.
Step 1
Step 1 - Set up the problem.
In this problem: The power is \(x\), so \(n = 1\).
Step 2
Step 2 - Write the power rule for integration.
In this problem: Raise the exponent by one, then divide by the new exponent.
Step 3
Step 3 - Substitute the exponent into the formula.
In this problem: Here \(n = 1\). Put it into the formula, but do not simplify yet.
Step 4
Step 4 - Solve and simplify, adding C.
In this problem: The new exponent is \(1 + 1 = 2\).
Final Answer
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\).
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}}\).
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Identify the type of equation.
- Rearrange the equation.
- Work out what to integrate.
- Integrate.
- 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.
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.
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\).
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\).
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}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant rule for integration.
- Multiply the constant by x and add the constant of integration C.
Step 1
Step 1 - Identify the constant k.
In this problem: The constant is \(k = 1\).
Step 2
Step 2 - Write the constant rule for integration.
In this problem: The integral of a constant is the constant times x.
Step 3
Step 3 - Multiply the constant by x and add the constant of integration C.
In this problem: The antiderivative is \(x\).
Final Answer
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}\).
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\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the integration by parts formula.
- Choose u and dv (LIATE: Log, Inverse trig, Algebraic, Trig, Exponential), then find du and v as Step 3a and Step 3b.
- Substitute u, v and du into the formula.
- Integrate the remaining integral.
- Simplify and add C.
Step 1
Step 1 - Set up the problem.
In this problem: We are integrating a product of two different kinds of functions.
Step 2
Step 2 - Write the integration by parts formula.
In this problem: Integration by parts trades one integral for an easier one.
Step 3
Step 3 - Choose u and dv.
In this problem: By LIATE, choose \(u = x\) and \(dv = e^{x} \, dx\).
Step 3a
Step 3a - Differentiate u to find du.
In this problem: The derivative of \(x\) is \(1\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the variable rule formula.
- Apply the variable rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x\). This is just the variable \(x\).
Step 2
Step 2 - Write the variable rule formula.
In this problem: The variable rule says the derivative of \(x\) with respect to \(x\) is \(1\).
Step 3
Step 3 - Apply the variable rule.
In this problem: Put \(x\) into the rule from Step 2, so its derivative is \(1\).
Final Answer
Step 3b
Step 3b - Integrate dv to find v.
In this problem: The integral of \(e^{x}\) is \(e^{x}\). The constant C is left until the end.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the integration rule for that exponential function.
- Apply the integration rule and add C.
Step 1
Step 1 - Set up the problem.
In this problem: The function is \(e^{x}\).
Step 2
Step 2 - Write the integration rule for that exponential function.
In this problem: The integral of \(e^{x}\) is itself.
Step 3
Step 3 - Apply the integration rule and add C.
In this problem: Put \(e^{x}\) into the rule from Step 2.
Final Answer
Step 4
Step 4 - Substitute u, v and du into the formula.
In this problem: Put u, v and du into the formula.
Step 5
Step 5 - Integrate the remaining integral.
In this problem: The remaining integral is \(\int e^{x}\, dx\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the integration rule for that exponential function.
- Apply the integration rule and add C.
Step 1
Step 1 - Set up the problem.
In this problem: The function is \(e^{x}\).
Step 2
Step 2 - Write the integration rule for that exponential function.
In this problem: The integral of \(e^{x}\) is itself.
Step 3
Step 3 - Apply the integration rule and add C.
In this problem: Put \(e^{x}\) into the rule from Step 2.
Final Answer
Step 6
Step 6 - Simplify and add C.
In this problem: Put the result of Step 5 into Step 4, simplify and add C.
Final Answer
Step 7
Step 7 - Solve for y.
In this problem: Dividing both sides by \(e^{x}\) gives \(y = C e^{- x} + x - 1\).
Final Answer
See Example 3 Hide Example 3
Problem
Approach
Step-by-step method
- Set up the problem.
- Identify the type of equation.
- Rearrange the equation.
- Work out what to integrate.
- Integrate.
- 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.
Step 1
Step 1 - Set up the problem.
In this problem: We are solving the first-order differential equation \(y' = 2 y\), which means finding every function \(y(x)\) that makes it true.
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.
Step 3
Step 3 - Separate the variables.
In this problem: Writing \(y'\) as \(\frac{dy}{dx}\), the right side is \(2 \cdot y\). Dividing by \(y\) and multiplying by \(dx\) separates the variables.
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\).
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|\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the reciprocal rule for integration.
- Apply the reciprocal rule and add C.
Step 1
Step 1 - Set up the problem.
In this problem: The function is \(\frac{1}{y}\).
Step 2
Step 2 - Write the reciprocal rule for integration.
In this problem: The integral of one over x is the natural logarithm of the absolute value of x. This is the special case the power rule cannot handle.
Step 3
Step 3 - Apply the reciprocal rule and add C.
In this problem: Put \(\frac{1}{y}\) into the rule from Step 2.
Final Answer
Step 4b
Step 4b - Integrate the x side.
In this problem: Integrating \(2\) with respect to \(x\), covered in the Constant Rule Integration Calculator, gives \(2 x\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant rule for integration.
- Multiply the constant by x and add the constant of integration C.
Step 1
Step 1 - Identify the constant k.
In this problem: The constant is \(k = 2\).
Step 2
Step 2 - Write the constant rule for integration.
In this problem: The integral of a constant is the constant times x.
Step 3
Step 3 - Multiply the constant by x and add the constant of integration C.
In this problem: The antiderivative is \(2 x\).
Final Answer
Step 5
Step 5 - Integrate.
In this problem: Putting the two sides together and adding one constant \(C\) gives \(\ln|y| = 2 x + 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^{2 x}\).
Final Answer
See Example 4 Hide Example 4
Problem
Approach
Step-by-step method
- Set up the problem.
- Identify the type of equation.
- Rearrange the equation.
- Work out what to integrate.
- Integrate.
- 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.
Step 1
Step 1 - Set up the problem.
In this problem: We are solving the first-order differential equation \(y' + 2 y = 4\), which means finding every function \(y(x)\) that makes it true.
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.
Step 3
Step 3 - Separate the variables.
In this problem: Writing \(y'\) as \(\frac{dy}{dx}\), the right side is \(1 \cdot \left(4 - 2 y\right)\). Dividing by \(\left(4 - 2 y\right)\) and multiplying by \(dx\) separates the variables.
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\).
Step 4a
Step 4a - Integrate the y side.
In this problem: Integrating \(- \frac{1}{2 y - 4}\) with respect to \(y\), covered in the U Substitution Calculator, gives \(- \frac{\ln{\left(2 y - 4 \right)}}{2}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the u-substitution formula.
- Choose the inner function u and find du.
- Rewrite the whole integral in terms of u.
- Integrate with respect to u.
- Put u back in terms of x and add C.
Step 1
Step 1 - Set up the problem.
In this problem: We are integrating \(- \frac{1}{2 y - 4}\). It contains an inner function whose derivative also appears as a factor.
Step 2
Step 2 - Write the u-substitution formula.
In this problem: When the integrand is a composite times the derivative of its inside, substitute u for the inside.
Step 3
Step 3 - Choose the inner function u and find du.
In this problem: Let \(u = y - 2\). Differentiating gives \(\frac{du}{dy} = 1\), so \(du = 1 \, dy\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the difference rule formula.
- Split the derivative across the subtraction signs.
- Differentiate each separated term as Step 4a, Step 4b, Step 4c, and so on.
- Combine the term derivatives and simplify.
Step 1
Step 1 - Set up the terms in the difference.
In this problem: We are given a difference. The separated terms are \(y\), \(2\).
Step 2
Step 2 - Write the difference rule formula.
In this problem: The difference rule says the derivative of a difference is the difference of the derivatives.
Step 3
Step 3 - Split the derivative across the subtraction signs.
In this problem: Apply the derivative to each separated term, keeping each sign.
Step 4a
Step 4a - Differentiate the separated term \(y\).
In this problem: The separated term is \(y\). Use the variable rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the variable rule formula.
- Apply the variable rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(y\). This is just the variable \(y\).
Step 2
Step 2 - Write the variable rule formula.
In this problem: The variable rule says the derivative of \(y\) with respect to \(y\) is \(1\).
Step 3
Step 3 - Apply the variable rule.
In this problem: Put \(y\) into the rule from Step 2, so its derivative is \(1\).
Final Answer
Step 4b
Step 4b - Differentiate the separated term \(2\).
In this problem: The separated term is \(2\). Use the constant rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant rule formula.
- Apply the constant rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(2\). This expression does not contain \(y\), so it is a constant.
Step 2
Step 2 - Write the constant rule formula.
In this problem: The constant rule says the derivative of any constant is \(0\).
Step 3
Step 3 - Apply the constant rule.
In this problem: Since \(2\) is constant, its derivative is \(0\).
Final Answer
Step 5
Step 5 - Combine and simplify.
In this problem: Combine the derivative from each separated term, keeping the signs, then simplify.
Final Answer
Step 4
Step 4 - Rewrite the whole integral in terms of u.
In this problem: Replace \(y - 2\) with u and \(1 \, dy\) with du. What is left is \(- \frac{1}{2 u}\).
Step 5
Step 5 - Integrate with respect to u.
In this problem: Integrate with respect to u.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the reciprocal rule for integration.
- Move the constant multiple outside the integral.
- Apply the reciprocal rule and add C.
Step 1
Step 1 - Set up the problem.
In this problem: The function is \(\frac{1}{u}\). The number \(- \frac{1}{2}\) in front is a constant multiple.
Step 2
Step 2 - Write the reciprocal rule for integration.
In this problem: The integral of one over x is the natural logarithm of the absolute value of x. This is the special case the power rule cannot handle.
Step 3
Step 3 - Move the constant multiple outside the integral.
In this problem: The number \(- \frac{1}{2}\) in front is a constant multiple, so it moves outside the integral and only \(\frac{1}{u}\) is integrated.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant multiple rule for integration.
- Pull the constant outside the integral.
Step 1
Step 1 - Identify the constant multiple k and the function f(x).
In this problem: The constant is \(k = - \frac{1}{2}\) and the function is \(\frac{1}{u}\).
Step 2
Step 2 - Write the constant multiple rule for integration.
In this problem: A constant factor can be moved outside the integral.
Step 3
Step 3 - Pull the constant outside the integral.
In this problem: Move \(- \frac{1}{2}\) in front of the integral sign and leave \(\frac{1}{u}\) inside.
Final Answer
Step 4
Step 4 - Apply the reciprocal rule and add C.
In this problem: Replace \(\int \frac{1}{u}\, du\) with \(\ln\left|u\right|\) from Step 2.
Final Answer
Step 6
Step 6 - Put u back in terms of x and add C.
In this problem: Replace u with \(y - 2\).
Final Answer
Step 4b
Step 4b - Integrate the x side.
In this problem: Integrating \(1\) with respect to \(x\), covered in the Constant Rule Integration Calculator, gives \(x\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant rule for integration.
- Multiply the constant by x and add the constant of integration C.
Step 1
Step 1 - Identify the constant k.
In this problem: The constant is \(k = 1\).
Step 2
Step 2 - Write the constant rule for integration.
In this problem: The integral of a constant is the constant times x.
Step 3
Step 3 - Multiply the constant by x and add the constant of integration C.
In this problem: The antiderivative is \(x\).
Final Answer
Step 5
Step 5 - Integrate.
In this problem: Putting the two sides together and adding one constant \(C\) gives \(- \frac{\ln{\left(2 y - 4 \right)}}{2} = x + 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^{- 2 x} + 2\).
Final Answer
Calculator and Practice Mode
Want to check your own working? The First Order ODE Solver Calculator solves any problem you type in and shows every step, so you can compare it line by line with your answer and find exactly where a mistake crept in. When you are ready to test yourself, First Order ODE Solver Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode for this calculator is available on the Pro plan.