First Year Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Linear and Bernoulli's differential equations

Linear first‑order differential equations and Bernoulli’s equation: definitions, integrating factor method, standard forms, solution steps, and exam‑style examples.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Engineers frequently model systems where the rate of change is proportional to the current state or input, such as RC circuits, Newton’s law of cooling, simple population models, and first‑order process dynamics. Linear and Bernoulli’s differential equations are standard first‑order models that admit systematic solution methods useful for design, control, and analysis.

Key ideas

  • Linear first‑order differential equation in y(x): An equation of the form dy/dx + P(x)·y = Q(x), where P and Q are given functions of x only. Assumes P and Q are continuous on an interval I. It is linear because y and dy/dx appear to the first power and are not multiplied together or inside nonlinear functions.
  • Linear first‑order differential equation in x(y): An equation of the form dx/dy + P₁(y)·x = Q₁(y), where P₁ and Q₁ are given functions of y only. Same linearity idea, but treating x as the dependent variable.
  • Integrating factor (IF): For dy/dx + P(x)·y = Q(x), an integrating factor is a nonzero function μ(x) such that the left side becomes an exact derivative: d/dx [μ(x)·y] = μ(x)·Q(x). The standard integrating factor is μ(x) = e^{∫ P(x) dx} (on an interval where the integral is defined). Assumes P is integrable on the interval.
  • General solution (linear first order): If P and Q are continuous on an interval I, the solution is obtained by multiplying the DE by μ(x) and integrating: y(x) = (1/μ(x)) [ ∫ μ(x)·Q(x) dx + C ]. If an initial condition y(x₀) = y₀ is given with x₀ ∈ I, the constant C is determined uniquely (existence–uniqueness theorem for linear ODEs).
  • Exact statement (integrating factor derivation): Consider dy/dx + P(x)·y = Q(x) with continuous P, Q on I. Define μ(x) = e^{∫ P(x) dx}. Then d/dx [ μ(x)·y ] = μ(x)·dy/dx + μ(x)·P(x)·y = μ(x)·[ dy/dx + P(x)·y ] = μ(x)·Q(x). Integrate both sides over x to obtain μ(x)·y = ∫ μ(x)·Q(x) dx + C, hence y = (1/μ) [ ∫ μ·Q dx + C ].
  • Bernoulli’s differential equation: A first‑order nonlinear DE of the form dy/dx + P(x)·y = Q(x)·yⁿ, where n is a real constant with n ≠ 0 and n ≠ 1. Assumes P and Q are continuous on I and y ≠ 0 (where needed) so that powers of y are defined. Special cases: when n = 0, the equation is linear; when n = 1, it reduces to the linear/separable form dy/dx = (Q(x) − P(x))·y and is treated by the linear method. For n > 0, the identically zero solution y ≡ 0 also satisfies the original equation (though it is excluded by the substitution v = y^{1−n}).
  • Reduction of Bernoulli to linear form (standard substitution): For dy/dx + P(x)·y = Q(x)·yⁿ, let v = y^{1−n}. Then dv/dx = (1−n)·y^{−n}·dy/dx. Using the original equation to replace dy/dx, we obtain a linear DE in v: dv/dx + (1−n)·P(x)·v = (1−n)·Q(x). Solve this linear equation for v(x) by the integrating factor method, then back‑substitute y = v^{1/(1−n)}.
  • Linearity in x vs in y: Some equations that are not linear in y may be linear in x when treated as a function of y. If you can rewrite the equation as dx/dy + P₁(y)·x = Q₁(y), use the integrating factor μ(y) = e^{∫ P₁(y) dy} and proceed similarly.
  • Geometric picture (optional diagram in exams when asked): For the homogeneous linear case dy/dx + P(x)·y = 0 with constant P = k, solution curves are exponential: y = C·e^{−k x}. To sketch: draw axes x (horizontal) and y (vertical); plot several decaying exponentials for k > 0 (approaching y = 0 as x increases) or growing exponentials for k < 0. Label k and representative constants C. This helps visualize stability.

Assumptions commonly stated in university answers:

  • P and Q are continuous on the interval of interest (ensures integrability and, with an initial condition, uniqueness of solution for linear problems).
  • For Bernoulli, n is a real constant with n ≠ 0,1 and y stays in a domain where y^{1−n} is defined.
  • Integrals are taken on an interval where the antiderivatives exist; absolute values inside logarithms may define sub‑intervals by sign.

Formulas

dy/dx + P(x)·y = Q(x) — Linear first‑order DE in y; x: independent variable (e.g., s), y: dependent variable (e.g., m), P: 1/(unit of x), Q: unit of y per unit of x; applies when P and Q depend only on x.

μ(x) = e^{∫ P(x) dx} — Integrating factor for linear first‑order DE; μ is dimensionless; applies when P is integrable on the interval.

y(x) = (1/μ(x)) [ ∫ μ(x)·Q(x) dx + C ] — General solution after multiplying by the integrating factor; C is an arbitrary constant; applies to linear first‑order DEs.

dx/dy + P₁(y)·x = Q₁(y) — Linear first‑order DE in x; y: independent variable; x: dependent variable; P₁: 1/(unit of y), Q₁: unit of x per unit of y.

μ(y) = e^{∫ P₁(y) dy} — Integrating factor for linear first‑order DE in x(y); dimensionless; applies when P₁ is integrable.

dy/dx + P(x)·y = Q(x)·yⁿ — Bernoulli’s equation; n ∈ ℝ, n ≠ 0,1; P and Q are functions of x only.

v = y^{1−n} — Standard substitution to reduce Bernoulli’s equation; v dimension depends on y and n; applies when y and n make the power meaningful.

dv/dx + (1−n)·P(x)·v = (1−n)·Q(x) — Linear equation obtained from Bernoulli after substitution; solve for v with integrating factor e^{∫ (1−n)·P(x) dx}.

d/dx [ μ(x)·y ] = μ(x)·Q(x) — Product‑rule form after multiplying a linear DE by its integrating factor; used to integrate both sides.

Worked examples

Example 1 — Solve a linear first‑order DE Given: Solve dy/dx + (2/x)·y = x² for x > 0.

  1. Identify P and Q: P(x) = 2/x, Q(x) = x². Both continuous for x > 0.
  2. Integrating factor: μ(x) = e^{∫ (2/x) dx} = e^{2 ln x} = x² (using x > 0 so ln x defined without absolute values here).
  3. Multiply the equation by μ(x): x²·dy/dx + 2x·y = x⁴.
  4. Left side is exact derivative: d/dx [ x²·y ] = x⁴.
  5. Integrate both sides: x²·y = ∫ x⁴ dx = x⁵/5 + C.
  6. Solve for y: y(x) = x³/5 + C·x^{−2}.

Final answer: y(x) = x³/5 + C·x^{−2} for x > 0.

Example 2 — Solve a Bernoulli equation by reduction to linear Given: Solve dy/dx + (1/x)·y = x²·y² for x > 0.

  1. Identify P, Q, n: P(x) = 1/x, Q(x) = x², n = 2 (≠ 0,1), domain x > 0.
  2. Substitute v = y^{1−n} = y^{−1} = 1/y. Then dv/dx = −y^{−2}·dy/dx.
  3. From the original DE, express dy/dx: dy/dx = −(1/x)·y + x²·y².
  4. Compute dv/dx using step 2 and 3: dv/dx = −y^{−2}·[ −(1/x)·y + x²·y² ] = (1/x)·y^{−1} − x² = (1/x)·v − x². Rearranged: dv/dx − (1/x)·v = −x².
  5. This is linear in v with P_v(x) = −1/x and Q_v(x) = −x².
  6. Integrating factor: μ(x) = e^{∫ (−1/x) dx} = e^{− ln x} = x^{−1} (x > 0).
  7. Multiply through: x^{−1}·dv/dx − x^{−2}·v = −x. Left side is d/dx [ x^{−1}·v ] = −x.
  8. Integrate: x^{−1}·v = ∫ (−x) dx = −x²/2 + C.
  9. Solve for v: v = x·( −x²/2 + C ) = −x³/2 + C·x.
  10. Back‑substitute y = 1/v: y(x) = 1 / ( C·x − x³/2 ).

Final answer: y(x) = 1 / ( C·x − x³/2 ), valid where the denominator ≠ 0 and x > 0; additionally, y ≡ 0 is a solution of the original equation (excluded by the substitution v = 1/y).

Example 3 — Linear DE with variable coefficients (clean IF) Given: Solve (1 + x²)·dy/dx + 2x·y = (1 + x²)².

  1. Put in standard form: dy/dx + [2x/(1 + x²)]·y = (1 + x²). Here P(x) = 2x/(1 + x²), Q(x) = 1 + x²; both continuous for all real x.
  2. Integrating factor: μ(x) = e^{∫ 2x/(1 + x²) dx}. Let u = 1 + x² ⇒ du = 2x dx, so ∫ 2x/(1 + x²) dx = ∫ du/u = ln|u| = ln(1 + x²). Hence μ(x) = e^{ln(1 + x²)} = 1 + x² (positive for all x).
  3. Multiply the DE by μ: (1 + x²)·dy/dx + 2x·y = (1 + x²)². Left side is d/dx [ (1 + x²)·y ].
  4. Integrate: d/dx [ (1 + x²)·y ] = (1 + x²)² ⇒ (1 + x²)·y = ∫ (1 + 2x² + x⁴) dx.
  5. Compute the integral: ∫ (1 + 2x² + x⁴) dx = x + (2/3)·x³ + (1/5)·x⁵ + C.
  6. Solve for y: y(x) = [ x + (2/3)·x³ + (1/5)·x⁵ + C ] / (1 + x²).

Final answer: y(x) = [ x + (2/3)·x³ + (1/5)·x⁵ + C ] / (1 + x²).

Notes on units for examples: If x represents time in seconds (s) and y represents temperature in kelvin (K), then P(x) has unit s⁻¹, and Q(x) has unit K·s⁻¹ such that both sides of dy/dx + P y = Q have unit K·s⁻¹. The integrating factor μ is always dimensionless.

Common mistakes

  • Incorrect product rule recognition: after multiplying by μ, the left side must become d/dx [ μ·y ]. If it doesn’t, re‑check μ.
  • For Bernoulli, using the wrong substitution (e.g., v = y^{n−1} instead of v = y^{1−n}) or mishandling dv/dx calculation.
  • Ignoring domain issues: missing the absolute value inside logarithms when integrating P(x) = 1/x; forgetting to state x > 0 (or x < 0) when simplifying e^{ln|x|} to x.
  • Not using the initial/boundary condition to find C when asked; or plugging it in before fully simplifying the general solution.
  • Mixing “linear in y” and “linear in x”: treating dx/dy + P₁(y)·x = Q₁(y) with an integrating factor in x instead of y.

For your exam

  • Derivations: Full derivation of the integrating factor μ(x) = e^{∫ P dx} and the Bernoulli reduction v = y^{1−n} leading to dv/dx + (1−n)·P·v = (1−n)·Q.
  • Procedural problems: Solve given linear ODEs with variable coefficients; solve Bernoulli equations; solve equations linear in x with respect to y; apply an initial condition to find the particular solution.
  • Conceptual/diagram: For constant‑coefficient homogeneous dy/dx + k·y = 0, sketch exponential solutions and label axes and parameters if a qualitative question appears.

Full‑marks expectations:

  • Correct standard form and clear identification of P and Q (and n for Bernoulli).
  • Correct integrating factor with the integral shown. State domain if needed (e.g., x > 0).
  • Product‑rule step explicitly written and integrated correctly; constants of integration included once and used appropriately.
  • For Bernoulli: correct substitution, correct linear v‑equation, correct IF for v, and clear back‑substitution to y with domain notes.
  • If an initial condition is given, compute C cleanly and present the final simplified expression.
  • Units interpretation where applicable and neat, stepwise presentation.

Quick check

  1. What is the integrating factor for dy/dx + (3/x)·y = sin x on x > 0?
  2. Which substitution reduces dy/dx + P(x)·y = Q(x)·y^{1/2} to a linear equation?
  3. Solve dx/dy + x·tan y = sec y for x as a function of y.

Answers: (1) μ(x) = e^{∫ 3/x dx} = x³ (for x > 0). (2) v = y^{1−(1/2)} = y^{1/2}. (3) This is linear in x: P₁(y) = tan y, Q₁(y) = sec y; μ(y) = e^{∫ tan y dy} = e^{−ln|cos y|} = 1/|cos y|. Using any nonzero constant multiple as an integrating factor, we may take μ(y) = sec y on an interval where cos y has fixed sign. Then d/dy [ x·sec y ] = sec y·sec y = sec² y ⇒ x·sec y = ∫ sec² y dy = tan y + C ⇒ x(y) = (tan y + C)·cos y.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?