Answer: \(y=(x^2+6x+5)\ln\left(\frac{5(x+1)}{x+5}\right)\).
Rewrite the differential equation as
\(\displaystyle \frac{dy}{dx}+P(x)y=4\), where \(P(x)=-\frac{2x+6}{x^2+6x+5}\).
An integrating factor is
\(\displaystyle \mu(x)=e^{\int P(x)\,dx}=e^{\int -\frac{2x+6}{x^2+6x+5}\,dx}.\)
Since \(\frac{d}{dx}(x^2+6x+5)=2x+6\),
\(\displaystyle \int -\frac{2x+6}{x^2+6x+5}\,dx=-\ln(x^2+6x+5),\)
so
\(\displaystyle \mu(x)=e^{-\ln(x^2+6x+5)}=\frac{1}{x^2+6x+5}.\)
Multiplying the equation by this integrating factor gives
\(\displaystyle \frac{d}{dx}\left(\frac{y}{x^2+6x+5}\right)=\frac{4}{x^2+6x+5}.\)
Now factor the denominator:
\(x^2+6x+5=(x+1)(x+5),\)
so
\(\displaystyle \frac{4}{x^2+6x+5}=\frac{4}{(x+1)(x+5)}=\frac{1}{x+1}-\frac{1}{x+5}.\)
Integrating,
\(\displaystyle \frac{y}{x^2+6x+5}=\int \left(\frac{1}{x+1}-\frac{1}{x+5}\right)dx=\ln\left|\frac{x+1}{x+5}\right|+C.\)
Use \(y=0\) when \(x=0\):
\(\displaystyle 0=\ln\left(\frac{1}{5}\right)+C,\)
so \(C=\ln 5\).
Hence
\(\displaystyle \frac{y}{x^2+6x+5}=\ln\left(\frac{x+1}{x+5}\right)+\ln 5=\ln\left(\frac{5(x+1)}{x+5}\right).\)
Therefore
\(\displaystyle y=(x^2+6x+5)\ln\left(\frac{5(x+1)}{x+5}\right).\)