University Differential Equations · Sheet 05 of 9 All 9 sheets →
  1. Home
  2. Worksheets
  3. University Differential Equations
  4. Nonhomogeneous Equations and Variable Coefficients
University Differential Equations Nonhomogeneous Equations and Variable Coefficients Free · no sign-up

University Differential Equations — Nonhomogeneous Equations and Variable Coefficients Worksheet

The second half of the second-order story: what to do when the right-hand side is not zero, and what to do when the coefficients are not constant. Guessing the form of a particular solution from the shape of the forcing term, and fixing the guess when part of it already solves the homogeneous equation; variation of parameters, the method that works when no guess will; Cauchy-Euler equations, where the trial function is a power of x instead of an exponential; and reduction of order, which turns one known solution into a second. Every question ends with a general solution or a solved initial value problem, and most of the marks sit in one decision made before any algebra starts. Have a look on this page, then print the free PDF when you want to write on it.

Page 1 of the University Differential Equations Nonhomogeneous Equations and Variable Coefficients practice worksheet

Practice worksheet — free PDF

6 pages 10 questions Letter size, print-ready

No email, no account, no watermark. Teachers: photocopy it for your classes freely. Worked solutions and 7 harder problems come with the University Differential Equations bundle.

All 10 questions

Each question targets one named concept from the sheet. Read them here, or print the PDF — it has working space under each one.

  1. Q1Undetermined Coefficients and the Form of the Trial Solution

    Here y=y(x).

    1. Find the general solution of y+3y+2y=4x2 by undetermined coefficients.
    2. For the same left-hand side y+3y+2y, write down the form of a trial particular solution for each right-hand side below. Do not evaluate the coefficients.\\ (i) xe3x (ii) excos2x (iii) 3sinx
  2. Q2Undetermined Coefficients and the Form of the Trial Solution

    Solve the initial value problem y4y+3y=10cost,y(0)=1,y(0)=0, where y=y(t).

  3. Q3Undetermined Coefficients When the Trial Solution Duplicates a Term

    Find the general solution of each equation, where y=y(x).

    1. y+2y3y=8ex
    2. y+4y=8x+2
  4. Q4Undetermined Coefficients When the Trial Solution Duplicates a Term

    Solve the initial value problem y6y+9y=6e3t,y(0)=1,y(0)=2, where y=y(t).

  5. Q5Variation of Parameters

    Use variation of parameters to find the general solution of y4y+4y=e2xx2,x>0, where y=y(x).

  6. Q6Variation of Parameters

    Use variation of parameters to find the general solution of y+9y=9sec23x on the interval (π6,π6), where y=y(x).

  7. Q7Cauchy-Euler Equations

    Find the general solution of each equation on (0,), where y=y(x).

    1. x2y2xy4y=0
    2. x2y+5xy+4y=0
    3. x2yxy+5y=0
  8. Q8Cauchy-Euler Equations

    Solve the initial value problem x2y+3xy3y=0,y(1)=4,y(1)=0, where y=y(x), and give the largest interval on which the solution is valid.

  9. Q9Reduction of Order from One Known Solution

    The function y1=ex is a solution of xy(x+1)y+y=0,x>0, where y=y(x). Use reduction of order, with y=u(x)ex, to find a second, linearly independent solution, and write the general solution.

  10. Q10Synthesis — drawing on several topics in this unit

    Consider y+4y=4x8sin2x, where y=y(x).

    1. Write the form of a trial particular solution, explaining which part of it had to be modified and why.
    2. Solve the initial value problem with y(0)=0 and y(0)=0.

The 7 challenge problems for this topic are a separate, paid sheet and are not reproduced here.

What does this set assume? This set stands on CEGEP Calculus I and II — the product rule, integration by parts, substitution and partial fractions are all used without comment, and the integrals in variation of parameters are meant to be routine — and on CEGEP Linear Algebra, because the Wronskian is a two-by-two determinant and variation of parameters solves its linear system by Cramer's rule. From the previous set, Homogeneous Linear Equations with Constant Coefficients, it uses the characteristic equation in all three root cases, complex roots written through Euler's formula, superposition and the Wronskian as a test of independence: every nonhomogeneous question here starts by solving that homogeneous equation. Only homogeneous Cauchy-Euler equations are in; the annihilator formulation of undetermined coefficients is not taught in this course. Forced springs, resonance and circuits are the next set, Mechanical Vibrations and Electric Circuits, and the series method for variable coefficients comes later, in Power Series Solutions.

Which course is this for? In the public course calendars of Montreal universities, this material is part of the courses numbered MATH 263, ENGR 213 and MAT265. Each course orders and weights the topics its own way, so check your own outline for what your exam covers. Which sets match your course.

How to do every concept on this sheet

This is the part worksheet sites usually leave out. Below is the actual reasoning behind each group of questions — not a full solution set, the decisions that get you to one. Read it before you start, or after you get stuck.

The structure every question here shares

A linear nonhomogeneous equation has a general solution with two pieces: the complementary solution yc, which is the general solution of the same equation with the right-hand side replaced by zero, and one particular solution yp of the equation as given. Everything in the first three sheets is a way of finding yp; yc always comes first, from the characteristic equation of the previous set.

y = yc + yp — yc carries the constants, yp carries none

Initial conditions go on the whole solution. In Q2, Q4, Q8 and Q10(b), apply y(0) and y′(0) only after yc + yp is assembled. Fitting the constants to yc alone, then adding yp, gives a function that no longer satisfies the conditions — the most common way to lose an initial value problem here.

Undetermined coefficients: the form of the trial solution

The method works because differentiating a polynomial, an exponential, a sine or a cosine returns more of the same family. So the guess for yp is the most general member of the family the right-hand side belongs to, with unknown coefficients, and substituting it into the equation turns the problem into matching coefficients.

Writing a trial particular solution

Read the forcing term, not the left-hand side.

  1. 1
    Polynomial of degree n

    Guess a full polynomial of degree n — every lower power included, down to the constant, even if the forcing term skips some.

  2. 2
    Exponential e^(ax)

    Guess a constant times e^(ax). Multiplied by a polynomial, guess a full polynomial of the same degree times e^(ax).

  3. 3
    Sine or cosine of bx

    Guess both: A cos bx + B sin bx, even when only one of them appears.

  4. 4
    Exponential times sine or cosine

    Guess e^(ax)(A cos bx + B sin bx).

  5. 5
    A sum of such terms

    Write one guess per term and add them; each piece can be found separately by superposition.

Q1(a) has a polynomial right-hand side, and the whole question turns on step 1: the forcing term is a single power of x, the guess is not. Q1(b) is the same decision three times with no arithmetic at all — for each of (i), (ii) and (iii), name the family, write the general member with letters for the coefficients, and stop. Part (iii) is a sum, so it takes step 5.

Check the guess against yc before you use it. Q1(b) keeps the left-hand side fixed on purpose: find the roots of its characteristic equation first, then compare each trial term with the complementary solution. That comparison is what the next sheet is about, and it has to become a habit before the forcing term makes it matter.

Q2 is a full initial value problem with a cosine on the right. By step 3 the guess needs a sine as well as a cosine: substitute, collect the cosine terms and the sine terms, and you get two equations in the two unknown coefficients. Then assemble y and apply the two conditions.

A missing sine is a missing equation. Guessing only A cos t in Q2 leaves a sine term on the left that nothing on the right can match, and the system has no solution. When coefficient matching looks inconsistent, the guess is usually too narrow, not the arithmetic wrong.

When the trial solution duplicates a term

If a term of your guess already solves the homogeneous equation, substituting it into the left side gives zero, and no choice of coefficient can make it equal the forcing term. The fix is the modification rule.

a trial term duplicates a term of yc → multiply that piece of the guess by x → repeat until nothing duplicates

Multiply by x, and only the piece that clashes. The factor x (or x², if one factor of x still leaves a duplicate) goes on the whole family that duplicates — every term of that polynomial, or both the cosine and the sine — and not on the other pieces of a sum. How many factors of x you need is decided by how many times the relevant root appears in the characteristic equation.

Q3 gives two equations and no hint about which, if either, needs the rule. In each part, find the roots of the characteristic equation, write yc, write the unmodified guess from the forcing term, and compare term by term. In part (b), remember that a constant is a polynomial term too: ask whether a constant solves the homogeneous equation before you decide the degree of your guess.

Q4 is an initial value problem with an exponential on the right. Before choosing the guess, find the roots of the characteristic equation and count how many times the exponential's rate appears among them — that count is the power of x the guess needs, and it may be zero, one or two. Then substitute, which is heavier than usual whenever the guess carries a power of x, because the product rule is applied twice, and fit the conditions.

Decide the power of x before you differentiate. If you start with too few factors of x, the substitution tells you so only by producing 0 = something, after the longest computation in the question. Checking the guess against yc costs one line and saves the page.

Variation of parameters

Undetermined coefficients needs a forcing term from a family that closes under differentiation. A quotient like the one in Q5, or a power of a secant like the one in Q6, is not in any such family, and no finite guess works. Variation of parameters replaces the constants of yc by functions and finds them.

Variation of parameters for y″ + p(x)y′ + q(x)y = f(x)

Standard form first, then a two-by-two system.

  1. 1
    Put the equation in standard form

    The coefficient of y″ must be 1. The f in the formula is the right-hand side after dividing by it.

  2. 2
    Find two independent solutions y1, y2

    From the characteristic equation, and compute their Wronskian W = y1y2′ − y1′y2.

  3. 3
    Solve for u1′ and u2

    By Cramer's rule: u1′ = −y2f/W and u2′ = y1f/W.

  4. 4
    Integrate, drop the constants, assemble

    yp = u1y1 + u2y2; the constants of integration only reproduce yc.

In Q5, start by deciding which of the three root cases the characteristic equation falls into; that fixes y1 and y2, and with them the Wronskian. Then write each u′ out in full and simplify before integrating — look for a factor that the forcing term and the homogeneous solutions have in common, because cancelling it first is what makes the integrals routine. The restriction x > 0 matters as soon as a logarithm appears.

Q6 pairs a trigonometric forcing term with a stated interval. Again the root case comes first. When y1 and y2 are trigonometric, their Wronskian simplifies through the Pythagorean identity, and the integrals that follow lean on the derivatives of secant and tangent and on standard trigonometric antiderivatives, all CEGEP Calculus II material. Use the interval in the statement: it tells you where the secant is defined and what sign it has, and so how to simplify any absolute value that an antiderivative produces.

The sign of u1′ and the scale of W. The minus sign belongs to u1′, the coefficient of the first solution, and it is the sign most often lost. And a Wronskian is not always 1: when the solutions have an argument like kx, the chain rule brings a factor k out of each derivative. Compute W, do not assume it.

Cauchy-Euler equations

In x²y″ + axy′ + by = 0 each derivative is multiplied by the matching power of x, so a power of x keeps its shape under the whole left-hand side. The trial solution is y = xm, and substituting it gives a quadratic in m — the indicial equation — whose roots play the part the characteristic roots played for constant coefficients.

y = xm → m(m − 1) + am + b = 0 — note the m(m − 1), not m²

From the roots of the indicial equation to the general solution on (0, ∞)

The same three cases, with ln x standing where x stood before.

  1. 1
    Two distinct real roots m1, m2

    y = c1xm1 + c2xm2.

  2. 2
    A repeated root m

    y = xm(c1 + c2 ln x): the second solution carries a logarithm, not a factor of x.

  3. 3
    Complex roots α ± βi

    y = xα(c1 cos(β ln x) + c2 sin(β ln x)).

Q7 gives three equations, and the point of putting them side by side is that you decide the case for each from the discriminant of its indicial equation — not by eye from the original equation. Build the indicial equation from a and b carefully in every part; the coefficient of y′ has a sign that changes from part to part.

The most common slip is m² in place of m(m − 1). The second derivative of xm is m(m − 1)xm−2, so the middle coefficient of the indicial equation is a − 1, not a. Writing m² + am + b is the characteristic equation of a different equation.

Q8 is a Cauchy-Euler initial value problem with its conditions at x = 1, which is the convenient point because every power of 1 is 1 and ln 1 = 0. The second request is new: give the largest interval on which the solution is valid. Read that off the equation, not the solution — divide by the leading coefficient to reach standard form, see where the coefficients stop being continuous, and take the interval containing the initial point.

Reduction of order from one known solution

When the coefficients are neither constant nor Cauchy-Euler, there may be no guess that works, but one known solution y1 is enough to find a second. Q9 supplies y1 and tells you to substitute y = u(x)y1.

Reduction of order with y = u(x)y1

A second-order equation in u becomes first-order in w = u′.

  1. 1
    Differentiate y = uy1 twice

    Product rule both times; write y′ and y″ in terms of u, u′, u″.

  2. 2
    Substitute and collect

    Every term with u alone cancels, because y1 is a solution. If it does not cancel, there is an error above.

  3. 3
    Set w = u′

    What is left is a first-order equation in w — separable, or linear with an integrating factor.

  4. 4
    Solve for w, integrate for u, choose simply

    Any non-constant u will do; set the constants conveniently, then y2 = uy1.

The cancellation is a free check. Step 2 always removes the u terms. In Q9 that happens with coefficients that depend on x, so keep the x and the x + 1 as whole factors while collecting. The integral in step 4 may need integration by parts, and the question asks for the general solution, so finish by writing c1y1 + c2y2 and confirm the two are not multiples of each other.

The synthesis question

Q10 puts the two undetermined-coefficients sheets on one equation. Its forcing term is a sum of a polynomial and a trigonometric term, so step 5 applies: write a guess for each piece. Part (a) then asks you to decide which of those pieces duplicates a term of yc and to say why in words — the answer is a sentence comparing the trial terms with the complementary solution, exactly the check Q1(b) and Q3 practise. Part (b) is Q2 and Q4 together: find the coefficients piece by piece, assemble the whole solution, and only then apply the two zero conditions.

Preview all 6 pages

Click any page to open the full PDF.

Page 1 of the University Differential Equations Nonhomogeneous Equations and Variable Coefficients practice worksheet
Page 1
Page 2 of the University Differential Equations Nonhomogeneous Equations and Variable Coefficients practice worksheet
Page 2
Page 3 of the University Differential Equations Nonhomogeneous Equations and Variable Coefficients practice worksheet
Page 3
Page 4 of the University Differential Equations Nonhomogeneous Equations and Variable Coefficients practice worksheet
Page 4
Page 5 of the University Differential Equations Nonhomogeneous Equations and Variable Coefficients practice worksheet
Page 5
Page 6 of the University Differential Equations Nonhomogeneous Equations and Variable Coefficients practice worksheet
Page 6

Getting the most out of it

Write yc before you write any guess

Every method in this set starts from the complementary solution — undetermined coefficients to check for duplication, variation of parameters for y1 and y2, the initial value problems for the full solution. Solve the homogeneous equation first, on its own line, every time.

Choose the method from the forcing term

Polynomials, exponentials, sines, cosines and their products: undetermined coefficients, which is usually faster. Anything else — a quotient, a secant, a logarithm — or variable coefficients: variation of parameters. Make the choice before you start and write it down; switching halfway wastes the most time.

Say out loud what family each term belongs to

Before writing a trial solution, name the family of each forcing term ("degree-two polynomial", "exponential times cosine") and the full general member it calls for. Q1(b) is exactly this drill; repeat it on any equation you meet until the guess comes with its missing terms already in.

Check a particular solution by substituting it

Once you have yp, put it back into the left-hand side. It must return the forcing term exactly. This catches a wrong coefficient, a lost sign in variation of parameters and a guess that needed another factor of x, and it takes less time than re-reading your algebra.

Want the solutions, or something more challenging?

The worksheet, the questions above and every explanation on this page stay free permanently. Three more PDFs exist for this topic — the worked answer key, a harder problem set, and the answer key to that. They come with the University Differential Equations Solutions Bundle, beside the unit notes and the unit test, which is what keeps the rest of the series free.

What else exists for Nonhomogeneous Equations and Variable Coefficients

Three PDFs · 12 pages · all three are in the bundle below.

  • Answer key — 3 pages. All 10 questions worked step by step, including the restrictions and the justifications. Not a list of final answers.
  • Challenge problems — 5 pages, 7 problems. A separate sheet at exam-plus difficulty covering the same 5 concepts. Harder than anything on the free sheet.
  • Challenge answer key — 4 pages. Every challenge problem worked to the same standard, with the checks shown.
  • PDF, letter size, print-ready.
In the bundle See what's in it Not sold separately

The one thing that's for sale

Best value for the whole year

Every University Differential Equations topic — the complete Solutions Bundle

One download, one payment, the whole program. For all 9 University Differential Equations units: the worksheet, the reference notes, the challenge set, the unit test and every answer key — including this one.

9 units · 36 PDFs · 182 pages$24.99
  • Worked solutions, not answer lists — every step written out
  • Covers the whole year's program at this level
  • Less than the price of one hour of tutoring — for the entire year's solutions
Everything paid, in one file $24.99CAD · one payment University Differential Equations bundle — coming soon Not on sale yet

Taking Secondary 1 Math as well? The Secondary 1 Math bundle covers all 15 of its units — 106 PDFs, 474 pages — on the same terms.

Taking Secondary 2 Math as well? The Secondary 2 Math bundle covers all 14 of its units — 98 PDFs, 449 pages — on the same terms.

Taking Secondary 3 Math as well? The Secondary 3 Math bundle covers all 11 of its units — 77 PDFs, 367 pages — on the same terms.

Taking Secondary 4 Math as well? The Secondary 4 Math bundle covers all 17 of its units — 122 PDFs, 466 pages — on the same terms.

Taking Secondary 5 Math as well? The Secondary 5 Math bundle covers all 21 of its units — 147 PDFs, 589 pages — on the same terms.

Taking CEGEP Calculus I as well? The CEGEP Calculus I bundle covers all 9 of its units — 72 PDFs, 371 pages — on the same terms.

Taking CEGEP Calculus II as well? The CEGEP Calculus II bundle covers all 8 of its units — 64 PDFs, 335 pages — on the same terms.

Taking CEGEP Linear Algebra as well? The CEGEP Linear Algebra bundle covers all 7 of its units — 56 PDFs, 298 pages — on the same terms.

Taking University Calculus III as well? The University Calculus III bundle covers all 9 of its units — 72 PDFs, 516 pages — on the same terms.

Taking University Linear Algebra as well? The University Linear Algebra bundle covers all 9 of its units — 72 PDFs, 496 pages — on the same terms.

Taking University Business Math as well? The University Business Math bundle covers all 9 of its units — 36 PDFs, 190 pages — on the same terms.

Taking University Introductory Statistics as well? The University Introductory Statistics bundle covers all 9 of its units — 36 PDFs, 186 pages — on the same terms.

Taking University Discrete Math as well? The University Discrete Math bundle covers all 9 of its units — 36 PDFs, 155 pages — on the same terms.

Taking AP Calculus AB as well? The AP Calculus AB bundle covers all 8 of its units — 64 PDFs, 527 pages — on the same terms.

Common questions

Is this worksheet really free?

Yes — the questions are on this page to read, and the PDF downloads directly, no email and no account. The one paid item is optional: the complete University Differential Equations Solutions Bundle, which covers every set at this level.

Which university courses is this for?

The course codes listed on this page are taken from the public course calendars of universities that teach a first course in ordinary differential equations after CEGEP. Each course orders and weights the chapters its own way, and some reach a chapter later or not at all, so check the outline for your own section to see where this set falls in your term.

What do I need to know before starting this set?

CEGEP Calculus I and II, including integration by parts and partial fractions, and CEGEP Linear Algebra for two-by-two determinants and Cramer's rule. From this course you need the previous set: solving a constant-coefficient homogeneous equation in all three root cases, and the Wronskian.

When should I use variation of parameters instead of undetermined coefficients?

Undetermined coefficients only works for constant coefficients and a forcing term built from polynomials, exponentials, sines and cosines. Variation of parameters works for any continuous forcing term, and for variable coefficients once two independent solutions of the homogeneous equation are known. When both apply, undetermined coefficients is usually quicker.

How do I know when to multiply the trial solution by x?

When a term of your guess already solves the homogeneous equation. Compare the guess with the complementary solution term by term; multiply the clashing piece by x, and by x² if one factor is not enough. The number of factors matches how often the relevant root appears in the characteristic equation.

Why does variation of parameters need the equation in standard form?

The formulas for u₁′ and u₂′ are derived for an equation whose second-derivative coefficient is 1. If the equation carries a coefficient in front of y″, divide by it first; the forcing term in the formulas is the right-hand side after that division.

Why is the trial solution for a Cauchy-Euler equation a power of x?

Because each derivative is multiplied by the matching power of x, so every term of the left-hand side comes back as a multiple of the same power. Substituting x to the m reduces the equation to a quadratic in m, just as an exponential does for constant coefficients.

Are nonhomogeneous Cauchy-Euler equations and series solutions in this set?

No. Only homogeneous Cauchy-Euler equations are covered here. Equations with variable coefficients that are not of Cauchy-Euler form, and that come with no known solution, are handled by power series in a later set, Power Series Solutions.

Can teachers use this in class?

Yes. Print and photocopy it for your own classes freely — I just ask that the tutorinmontreal.ca footer stays on the page.

I'm stuck on one question. Can you help?

Yes — through one-on-one tutoring, in Montreal or online. Get in touch to arrange a session, or see the current rates.

← All 9 University Differential Equations worksheets  ·  Secondary 1 Math series (15 sheets) →  ·  Secondary 2 Math series (14 sheets) →  ·  Secondary 3 Math series (11 sheets) →  ·  Secondary 4 Math series (17 sheets) →  ·  Secondary 5 Math series (21 sheets) →  ·  CEGEP Calculus I series (9 sheets) →  ·  CEGEP Calculus II series (8 sheets) →  ·  CEGEP Linear Algebra series (7 sheets) →  ·  University Calculus III series (9 sheets) →  ·  University Linear Algebra series (9 sheets) →  ·  University Business Math series (9 sheets) →  ·  University Introductory Statistics series (9 sheets) →  ·  University Discrete Math series (9 sheets) →  ·  AP Calculus AB series (8 sheets) →

Download the free worksheet

Ready to improve your grades?

WhatsApp is the way to reach me — tell me the course you're taking and what you're stuck on, and we'll sort out a first session from there.

Message Me on WhatsApp

or send a message

I reply within a day, usually sooner. Your details are used only to answer you — see the Privacy Policy.

Private math & science tutoring in Montreal, QC — Westmount · Outremont · Town of Mount Royal · Hampstead · Côte-Saint-Luc · NDG · Nuns' Island · West Island — and online across Quebec.

Chat with Marius