WhatsApp us
University Maths18 Nov 2026

First Order Differential Equations: Separable, Linear and Exact, with Practice Problems

How to recognise and solve the three main types of first order differential equations (separable, linear and exact), with six graded worked examples, a method-choice table, common mark-losing slips and practice problems with answers.

First Order Differential Equations: Separable, Linear and Exact, with Practice Problems

A first order differential equation links y, x and dy/dx, and most of the ones you meet in a first course fall into three types: separable (split the x and y parts and integrate), linear (multiply by an integrating factor) and exact (find a function whose total differential is the equation). The skill that decides marks is spotting the type in the first minute, so this guide starts with recognition, then works six graded examples and ends with a practice set with answers.

Spot the type before you touch the algebra

Rewrite the equation as dy/dx = f(x, y), or as M(x, y) dx + N(x, y) dy = 0, then ask these questions in order.

CheckWhat it looks likeMethod
Does f(x, y) factor as g(x)·h(y)?dy/dx = x²·(y − 1), dy/dx = e^(x+y)Separate and integrate
Is it y′ + P(x)y = Q(x), with y only to the first power?y′ + 3y/x = x²Integrating factor e^(∫P dx)
Is it y′ + P(x)y = Q(x)·yⁿ?y′ + y = x·y³Bernoulli: let v = y^(1−n), then linear
In M dx + N dy = 0, is ∂M/∂y = ∂N/∂x?(2xy + 3) dx + (x² + 4y) dy = 0Exact: find F with F_x = M, F_y = N
Not exact, but (M_y − N_x)/N depends on x only?see Example 6Integrating factor μ(x), then exact
Is f a function of y/x only?dy/dx = (x² + y²)/(xy)Substitute y = vx, then separable

Some equations pass more than one test. dy/dx = 2y + 6 is both separable and linear; use whichever you will finish faster and more safely. If you want a guided route through all of this with your own course problems, our online differential equations tutoring page explains how sessions with Ajay Vatsyayan work.

Separable equations

Move every y onto the side with dy and every x onto the side with dx, integrate both sides, and add one constant.

Example 1 (warm-up): an initial value problem

Solve dy/dx = (2x + 1)/(3y²) with y(0) = 2.

Separate:

3y² dy = (2x + 1) dx

Integrate both sides:

y³ = x² + x + C

Use y(0) = 2: 8 = 0 + 0 + C, so C = 8.

Answer: y³ = x² + x + 8, so y = ∛(x² + x + 8).

Check by differentiating: 3y²·y′ = 2x + 1, which is the original equation.

Example 2: the solution you lose by dividing

Solve dy/dt = 3t²(y − 5) with y(0) = 7.

Before dividing by (y − 5), notice that y = 5 makes both sides zero. It is a constant (equilibrium) solution. Now assume y ≠ 5 and separate:

dy/(y − 5) = 3t² dt

ln|y − 5| = t³ + C

Exponentiate: y − 5 = ±e^C·e^(t³) = A·e^(t³), where A can be any non-zero constant.

Allowing A = 0 brings back the equilibrium y = 5, so the general solution is y = 5 + A·e^(t³) for any A. With y(0) = 7, A = 2.

Answer: y = 5 + 2e^(t³).

The point of this example is the step most students skip: when you divide by an expression in y, say what happens when that expression is zero. In a problem set, "find all solutions" usually means the equilibrium counts.

Linear equations and the integrating factor

Put the equation in standard form y′ + P(x)y = Q(x), with the coefficient of y′ equal to 1. Then:

  1. Integrating factor: μ(x) = e^(∫P dx). No constant is needed here.
  2. Multiply through. The left side becomes (μy)′.
  3. Integrate: μy = ∫μQ dx + C.
  4. Divide by μ. The constant gets divided too.

When ∫μQ dx needs a product rule in reverse, the techniques in our integration by parts guide apply directly.

Example 3: standard form first

Solve x·dy/dx + 2y = 4x² for x > 0, with y(1) = 3.

Divide by x so that y′ has coefficient 1:

y′ + (2/x)y = 4x

P(x) = 2/x, so ∫P dx = 2 ln x and μ = e^(2 ln x) = x².

Multiply: x²y′ + 2xy = 4x³, and the left side is (x²y)′.

Integrate: x²y = x⁴ + C.

Use y(1) = 3: 3 = 1 + C, so C = 2.

Answer: y = x² + 2/x².

Example 4: a mixing tank (applied)

A tank holds 200 litres of water with 10 kg of salt dissolved in it. Brine containing 0.3 kg of salt per litre flows in at 4 litres per minute, and the well-mixed solution flows out at the same rate. Find the salt Q(t) after t minutes and the time when the tank holds 40 kg.

Rate in = 0.3 × 4 = 1.2 kg per minute.

Rate out = (concentration) × (flow) = (Q/200) × 4 = Q/50 kg per minute.

dQ/dt = 1.2 − Q/50, with Q(0) = 10.

Standard form: Q′ + Q/50 = 1.2. The integrating factor is e^(t/50).

(Q·e^(t/50))′ = 1.2e^(t/50)

Q·e^(t/50) = 60e^(t/50) + C

Q = 60 + C·e^(−t/50). With Q(0) = 10, C = −50.

Answer: Q(t) = 60 − 50e^(−t/50).

For 40 kg: 50e^(−t/50) = 20, so t = 50 ln 2.5 ≈ 45.8 minutes.

Sanity check: as t → ∞, Q → 60 kg, which is 0.3 kg per litre × 200 litres. A limit that matches the inflow concentration is a quick way to catch a sign slip.

Exact equations

M dx + N dy = 0 is exact when ∂M/∂y = ∂N/∂x. Then there is a function F(x, y) with F_x = M and F_y = N, and the solution is F(x, y) = C. If partial derivatives still feel shaky, revise them in our guide to partial derivatives and the gradient first; exactness is nothing more than equality of mixed partials.

Example 5: test, build F, apply the condition

Solve (2xy + 3) dx + (x² + 4y) dy = 0 with y(1) = 1.

Test: M = 2xy + 3 gives M_y = 2x. N = x² + 4y gives N_x = 2x. Equal, so exact.

Integrate M with respect to x, holding y fixed:

F = x²y + 3x + g(y)

Differentiate with respect to y and match N:

F_y = x² + g′(y) = x² + 4y, so g′(y) = 4y and g(y) = 2y².

F(x, y) = x²y + 3x + 2y².

Use y(1) = 1: F = 1 + 3 + 2 = 6.

Answer: x²y + 3x + 2y² = 6 (an implicit solution; leave it in this form unless asked for y explicitly).

Example 6 (exam level): not exact until you fix it

Solve (2y³ + 4x²y) dx + (3xy² + x³) dy = 0 with y(1) = 1.

Test: M_y = 6y² + 4x² and N_x = 3y² + 3x². Not equal, so not exact.

Try an integrating factor that depends on x only:

(M_y − N_x)/N = (3y² + x²)/(x(3y² + x²)) = 1/x

This depends on x alone, so μ(x) = e^(∫(1/x) dx) = x.

Multiply the equation by x:

(2xy³ + 4x³y) dx + (3x²y² + x⁴) dy = 0

Now M_y = 6xy² + 4x³ and N_x = 6xy² + 4x³. Exact.

Integrate the new M with respect to x: F = x²y³ + x⁴y + g(y).

F_y = 3x²y² + x⁴ + g′(y), which already equals the new N, so g′(y) = 0.

Answer: x²y³ + x⁴y = 2, using y(1) = 1 to get the constant.

If (M_y − N_x)/N had involved y, the next thing to try is (N_x − M_y)/M, which gives a factor μ(y) when it depends on y alone.

Where students lose marks

  • Adding the constant in the wrong place. From ln|y| = x² + C the solution is y = A·e^(x²), not y = e^(x²) + C. Exponentiate first, then rename e^C as A.
  • Dividing by zero without comment. Dividing by (y − 5) or by y discards a constant solution. Write one line saying what happens when the divisor is zero.
  • Skipping standard form. The integrating factor e^(∫P dx) only works when y′ has coefficient 1. In Example 3, using P = 2 instead of 2/x gives a wrong answer that still looks plausible.
  • Losing the sign of P. For y′ − 3y = x, P = −3 and μ = e^(−3x). Read P with its sign.
  • Forgetting to divide the constant. In x²y = x⁴ + C, dividing gives y = x² + C/x², not x² + C.
  • Testing exactness with the wrong derivatives. It is ∂M/∂y against ∂N/∂x. Differentiating M with respect to x is a common slip under time pressure.
  • Double counting in F. When building F from both ∫M dx and ∫N dy, terms that appear in both are written once. Using g(y), as above, avoids the problem.
  • Not checking. Substituting back takes a minute and catches most errors. For implicit answers, differentiate implicitly and compare.

Practice problems with answers

Try each one before reading the answer.

  1. Solve dy/dx = y·cos x with y(0) = 3.
  2. Solve x·y′ + 3y = x² for x > 0, with y(1) = 1.
  3. Show that (y·e^x + 2x) dx + (e^x + 3y²) dy = 0 is exact and solve it.
  4. Solve the Bernoulli equation y′ + y = e^x·y² (hint: v = 1/y).
  5. A drink at 90°C is left in a room at 20°C and is at 70°C after 5 minutes. Using Newton's law of cooling, dT/dt = −k(T − 20), when does it reach 40°C?

Answers

  1. y = 3e^(sin x).
  2. y = x²/5 + 4/(5x³).
  3. M_y = N_x = e^x; the solution is y·e^x + x² + y³ = C.
  4. v′ − v = −e^x gives v = (C − x)e^x, so y = e^(−x)/(C − x). Also y = 0.
  5. T = 20 + 70e^(−kt) with k = (1/5) ln 1.4; T = 40 when t = 5 ln 3.5 / ln 1.4 ≈ 18.6 minutes.

Where this leads

First order methods come back everywhere in a differential equations course. Second order linear equations, covered in our guide to solving second order linear ODEs, reuse the idea of a general solution plus constants fixed by initial conditions. The Laplace transform turns the same initial value problems into algebra, which our Laplace transforms exam guide works through. Later, systems of equations and numerical methods (Euler and Runge–Kutta) start from exactly the form dy/dx = f(x, y). If you met growth, decay and separable equations at school, the IB Maths AA HL differential equations guide shows what you already know and where university picks up.

How Maths Bodhi helps

We work through your own problem sets and past papers with you, and review your attempts line by line so the method choice becomes automatic. B.Tech students can also see how we cover differential equations within Engineering Mathematics M1, M2 and M3, and the university maths tutoring hub lists every course we teach. We explain and practise; we don't complete graded work for you.

Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.

Written and checked by the Maths Bodhi team (November 2026).

Frequently asked questions

How do I know if a first order differential equation is separable?
It is separable if dy/dx can be written as a function of x multiplied by a function of y, such as x²(y − 1).
What is the integrating factor for a linear first order differential equation?
For y′ + P(x)y = Q(x), the integrating factor is e^(∫P dx), found after the coefficient of y′ is made equal to 1.
How do you check if a differential equation is exact?
Write it as M dx + N dy = 0 and check whether ∂M/∂y equals ∂N/∂x.
What if an equation is not exact?
Look for an integrating factor: if (M_y − N_x)/N depends only on x, use μ(x) = e^(∫ that dx).
Can a first order differential equation be both separable and linear?
Yes, for example dy/dx = 2y + 6; either method gives the same solution.
Do I need to give the answer as y = f(x)?
Only if asked or if it is easy; an implicit solution F(x, y) = C is a complete answer for exact equations.
differential equationsfirst order ODEintegrating factorexact equationsuniversity maths

Related guides

Keep exploring this maths topic

University Maths18 Nov 2026

Second Order Differential Equations: Constant Coefficients, Problems and Solutions

Solve second order linear differential equations with constant coefficients: the characteristic equation and its three root cases, undetermined coefficients with the modification rule, and a damped spring driven by a force, all worked step by step with practice problems.

differential equationssecond order ODEundetermined coefficientsmechanical vibrations

By Maths Bodhi Team

Read guide

University Maths2 Nov 2026

Laplace Transforms in Engineering Maths: An Exam Guide with Worked Examples

The Laplace transform questions that come up most in B.Tech and first-year engineering maths, the formula table to learn, six worked examples from direct transforms to unit-step initial value problems, the slips that cost marks, and a practice set with answers.

Laplace transformengineering mathematicsM2M3

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

Partial Derivatives, the Gradient and Directional Derivatives: Worked Examples

How to find partial derivatives, use the multivariable chain rule, build the gradient and compute directional derivatives, with six graded worked examples, a method table, common mistakes and a practice set with answers.

partial derivativesgradientdirectional derivativemultivariable calculus

By Maths Bodhi Team

Read guide

University Maths2 Nov 2026

How to Clear an Engineering Maths Back Paper (M1, M2 or M3)

A realistic plan for B.Tech students re-taking Engineering Mathematics M1, M2 or M3: confirm your scheme, map past papers, revise unit by unit, and master the high-yield question types through seven worked examples and a practice set with answers.

engineering maths back paperM1 back paperM2 back paperM3 back paper

By Maths Bodhi Team

Read guide

University Maths2 Nov 2026

First-Year Maths at KTH and Chalmers: A Guide for International Students

The main first-year calculus and linear algebra courses at KTH and Chalmers, how each university grades them, the Swedish-language question, five worked examples in the style of the written exams, a study-period plan and practice with answers.

KTH mathsChalmers mathsSweden university mathsEnvariabelanalys

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

Integration by Parts and the Tabular Method, With Worked Examples

The integration by parts formula, how to choose u (LIATE and when to break it), the tabular method for repeated parts and for exponential-times-trig integrals, six graded worked examples, common errors and practice with answers.

integration by partstabular methodCalculus IIintegration techniques

By Maths Bodhi Team

Read guide