<s>[INST] Am I allowed to use this method? Question: solve
$\frac{d^2y}{dx^2}+\frac{dy}{dx}=2x+3$.
My attempt:
The general solution to the corresponding homogeneous DE is $y_g=c_1+c_2e^{-x}$.
Now to find the particular integral, rewrite the DE as $$(D^2+D)y=2x+3$$
We have $y_p=\frac{1}{D(D+1)} (2x+3)$.
Then $y_p=\frac{1}{D+1}(x^2+3x)$.
Here's my question:
Am I allowed to use Taylor's expansion?
If this is allowed then I can find $y_p$ easily.
We would have $y_p=1-D+D^2-D^3+D^4-...(x^2+3x)$
and $y_p=x^2+3x-(2x+3)+2-0$
 [/INST] $$(D^2+D)y=2x+3$$
It means:
$$y''+y'=2x+3$$
Not the equation you write in the first line.
$$\frac{d^2y}{dx^2}y+\frac{dy}{dx}y=2x+3$$
$$y''y+y'y=2x+3$$
And yes you have that:
$$\dfrac 1{1+D}=1-D+D^2-D^3.......$$
But you have:
$$y_p=\frac{1}{D(D+1)} (2x+3)$$
$$y_p=\left (\dfrac{1}{D}-\dfrac 1 {D+1} \right)(2x+3)$$
$$y_p=\dfrac{1}{D} (2x+3)-\dfrac 1 {D+1} (2x+3)$$
$$y_p=(x^2+3x)-\dfrac 1 {D+1} (2x+3)$$
Or as you did:
$$y_p=\dfrac 1{D+1}(x^2+3x)=x^2+3x -(2x+3)+2$$
$$\implies y_p=x^2+x-1$$
</s>