I'm trying to solving a 2nd-order inhomogeneous differential equation, but I'm not sure with my answer since I'm only learned it by myself & it has nothing to do with school or homework, so I have no one to ask or correct my answer. Please if you want to help me, i would be really happy & appreciate your help & advice.

So here's my problem


and here's my step to answer

I know that to solve this 2nd-order inhomogeneous differential equation the general solution is


where $y_c$ is the general solution of the homogeneous equation. And $y_p$ is a particular solution

First, I find for $y_c$ through


since it's in the form of different roots of the auxiliary equation, i found that $m_1\:=\:2+\sqrt{2}$ and $m_2\:=\:2-\sqrt{2}$ , so the general solution of the homogeneous equation is


Second, since it's a polynomial problem so i find for $y_p$ through


first and second derivative of $y_p$ are


so now i have to find the undetermined coefficients $A$, $B$, and $C$. I find these coefficients through substitute $y_p$ into $y$, $y'_p$ into $y'$, and $y''_p$ into $y"$, thus


So, $A\:=\:\frac{1}{2}\:,\:B\:=\:0,\:C\:=\:\frac{1}{2}$ and then substitute this into $y_p$, I find the particular solution which is


and finally I find the general solution in the form of


This is my answer, am I correct or not? Thank you for your time!

  • 1
    $\begingroup$ No, can't be good as the only $x^2$ term in the LHS is $x^2$, while it is $2x^2$ in the RHS. Easier to start with $y=x^2+Ax+B$. $\endgroup$
    – user65203
    Sep 17, 2014 at 13:33
  • $\begingroup$ The second derivative should be typed as y'', not as y". (Compare the outputs: $y''$ and $y"$.) I also suggest cutting down the spending on emoticons; the freed up funds can be used to buy some uppercase letters. $\endgroup$
    – user147263
    Sep 20, 2014 at 6:23

4 Answers 4


The equation is $$ (D^{2}-4D+2)y=2x^{2} $$ Apply the annihilator $D^{3}$ of $x^{2}$ to obtain $$ D^{3}(D^{2}-4D+2)y=0. $$ The general solution of this equation is $$ f=e^{2x}(Ae^{\sqrt{2}x}+Be^{-\sqrt{2}x})+F+Gx+Hx^{2}. $$ Plugging back into the original equation eliminates the exponential terms and gives $$ \begin{align} (D^{2}-4D+2)f & =(D^{2}-4D+2)(F+Gx+Hx^{2}) \\ & =(2H)-4(G+2Hx)+2(F+Gx+Hx^{2}) \\ & =(2H-4G+2F)+(-8H+2G)x+2Hx^{2}= x^{2}. \end{align} $$ Therefore $$ \begin{array}{l} H=1/2\\ -8H+2G=0 \implies G=4H=2 \\ 2H-4G+2F=0 \implies F=2G-H=4-1/2=7/2. \end{array} $$ The final solution is $$ f = e^{2x}(Ae^{\sqrt{2}x}+Be^{-\sqrt{2}x})+\frac{7}{2}+2x+\frac{1}{2}x^{2}. $$ $A$ and $B$ are arbitrary constants.


Your steps look good. If you want to check the solution, plug the solution and its derivatives back into the original equation to see if it works.


Your $y_c$ part is fine but there is an error in $y_p$ part. Coefficients should be $A=1$, $B=4$ and $C=7$.


I would use various differential eq calculator to help

  1. https://www.emathhelp.net/en/calculators/differential-equations/differential-equation-calculator/

  2. https://mathdf.com/dif/

The results show that the answer should be $$y_p = x^2+4x+7 $$

Results from Calculator enter image description here

  • $\begingroup$ As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    May 14, 2022 at 13:36
  • $\begingroup$ While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review $\endgroup$
    – Ho-Oh
    May 14, 2022 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .