\(% Differentiation % https://tex.stackexchange.com/a/60546/ \newcommand{\Diff}{\mathop{}\!\mathrm{d}} \newcommand{\DiffFrac}[2]{\frac{\Diff #1}{\Diff #2}} \newcommand{\DiffOp}[1]{\frac{\Diff}{\Diff #1}} \newcommand{\Ndiff}[1]{\mathop{}\!\mathrm{d}^{#1}} \newcommand{\NdiffFrac}[3]{\frac{\Ndiff{#1} #2}{\Diff {#3}^{#1}}} \newcommand{\NdiffOp}[2]{\frac{\Ndiff{#1}}{\Diff {#2}^{#1}}} % Evaluation \newcommand{\LEvalAt}[2]{\left.#1\right\vert_{#2}} \newcommand{\SqEvalAt}[2]{\left[#1\right]_{#2}} % Epsilon & Phi \renewcommand{\epsilon}{\varepsilon} \renewcommand{\phi}{\varphi} % Sets \newcommand{\NN}{\mathbb{N}} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\RR}{\mathbb{R}} \newcommand{\CC}{\mathbb{C}} \newcommand{\PP}{\mathbb{P}} \renewcommand{\emptyset}{\varnothing} % Probabililty \DeclareMathOperator{\Cov}{Cov} \DeclareMathOperator{\Corr}{Corr} \DeclareMathOperator{\Var}{Var} \DeclareMathOperator{\Expt}{E} \DeclareMathOperator{\Prob}{P} % Distribution \DeclareMathOperator{\Binomial}{B} \DeclareMathOperator{\Poisson}{Po} \DeclareMathOperator{\Normal}{N} \DeclareMathOperator{\Exponential}{Exp} \DeclareMathOperator{\Geometric}{Geo} \DeclareMathOperator{\Uniform}{U} % Complex Numbers \DeclareMathOperator{\im}{Im} \DeclareMathOperator{\re}{Re} % Missing Trigonometric & Hyperbolic functions \DeclareMathOperator{\arccot}{arccot} \DeclareMathOperator{\arcsec}{arcsec} \DeclareMathOperator{\arccsc}{arccsc} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \DeclareMathOperator{\arsinh}{arsinh} \DeclareMathOperator{\arcosh}{arcosh} \DeclareMathOperator{\artanh}{artanh} \DeclareMathOperator{\arcoth}{arcoth} \DeclareMathOperator{\arsech}{arsech} \DeclareMathOperator{\arcsch}{arcsch} % UK Notation \DeclareMathOperator{\cosec}{cosec} \DeclareMathOperator{\arccosec}{arccosec} \DeclareMathOperator{\cosech}{cosech} \DeclareMathOperator{\arcosech}{arcosech} % Paired Delimiters \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} \DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \DeclarePairedDelimiter{\ang}{\langle}{\rangle} % Vectors \newcommand{\vect}[1]{\mathbf{#1}} \newcommand{\bvect}[1]{\overrightarrow{#1}} % https://tex.stackexchange.com/a/28213 % \DeclareMathSymbol{\ii}{\mathalpha}{letters}{"10} % \DeclareMathSymbol{\jj}{\mathalpha}{letters}{"11} % \newcommand{\ihat}{\vect{\hat{\ii}}} % \newcommand{\jhat}{\vect{\hat{\jj}}} \newcommand{\ihat}{\textbf{\^{ı}}} \newcommand{\jhat}{\textbf{\^{ȷ}}} \newcommand{\khat}{\vect{\hat{k}}} % Other Functions \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\tr}{tr} % Other Math Symbols \DeclareMathOperator{\modulo}{mod} \newcommand{\divides}{\mid} \newcommand{\notdivides}{\nmid} \newcommand{\LHS}{\text{LHS}} \newcommand{\RHS}{\text{RHS}} \newcommand{\degree}{^{\circ}}\)
By rearrangement, we have \[ \frac {\Diff u}{u} = \left (1 + \frac {1}{x + 1}\right ) \Diff x, \] and hence by integration, \[ \ln \abs *{u} = x + \ln \abs *{x + 1} + C. \]
This gives \[ u = C (x + 1) e^x \] as the general solution.
Since \(y = z e^{-x}\), we must have \[ \DiffFrac {y}{x} = \DiffFrac {z}{x} e^{-x} - z e^{-x} = \left (\DiffFrac {z}{x} - z\right ) e^{-x}, \] and \[ \NdiffFrac {2}{y}{x} = \NdiffFrac {2}{z}{x} e^{-x} - 2 \DiffFrac {z}{x} e^{-x} + z e^{-x} = \left (\NdiffFrac {2}{z}{x} - 2 \DiffFrac {z}{x} + z\right ) e^{-x}. \]
Hence, the original differential equation can be simplified: \begin {align*} (x + 1) \NdiffFrac {2}{y}{x} + x \DiffFrac {y}{x} - y & = 0 \\ (x + 1) \left (\NdiffFrac {2}{z}{x} - 2 \DiffFrac {z}{x} + z\right ) e^{-x} + x \left (\DiffFrac {z}{x} - z\right ) e^{-x} - z e^{-x} & = 0 \\ (x + 1) \left (\NdiffFrac {2}{z}{x} - 2 \DiffFrac {z}{x} + z\right ) + x \left (\DiffFrac {z}{x} - z\right ) - z & = 0 \\ (x + 1) \NdiffFrac {2}{z}{x} - (x + 2)\DiffFrac {z}{x} & = 0, \end {align*}
which is a first-order differential equation for \(\DiffFrac {z}{x}\).
Hence, from part (i), we have the general solution to this differential equation is \[ \DiffFrac {z}{x} = C(x + 1)e^x, \] and hence by integration \[ z = C \int (x + 1) e^x \Diff x = C \left [\int x \Diff e^x + \int e^x \Diff x\right ] = C [xe^x - e^x + e^x] + D. \]
Therefore, \(y = z e^{-x} = De^{-x} + Cx\). Let \(A = C\) and \(B = D\) and this is exactly what is desired.
The complementary function is the differential equation solved in the previous part. For the complementary function, consider \(y = ax^2 + b\), and hence \(\DiffFrac {y}{x} = 2ax\) and \(\NdiffFrac {2}{y}{x} = 2a\). Hence, \[ 2a(x + 1) + x \cdot 2ax - ax^2 - c = ax^2 + 2ax + (2a - c) = x^2 + 2x + 1. \]
Hence, \(a = 1\) and \(c = 1\) giving \(y = x^2 + 1\) is a particular integral.
Therefore, the general solution to the differential equation is \[ y = Ax + Be^{-x} + x^2 + 1. \]