Find the solution of the DE $$y'+2y = \frac{1}{1+x^2}\,\,\,\,\,\,\forall x \in \mathbb R$$ satisfying $y(0) = a$ where $a \in \mathbb R$ is a constant.
My attempt:
Since it's a linear ODE, therefore the Integration factor (I.F.) is $ e^{\int 2\,dx} = e^{2x}$.And the solution is $$ ye^{2x} = \int \frac{e^{2x}}{1+x^2} dx$$
I'm facing trouble in solving the integral. I tried using some online integral calculator but the solutions over there tends to include imaginary expressions. I'm not sure if my approach was incorrect or if I'm missing something while solving the ODE.
Edit: The question furter required us to find the value $$\lim_{x \to \infty} y_a(x)$$. Can we find the limit for $$y(x) = e^{-2x}\int \frac{e^{2x}}{1+x^2} dx + e^{-2x}C$$ where C is the constant of integration. I'm not sure how to use the initial value in this case. The solution is: $$\lim_{x \to \infty} y_a(x) = 0\,\,\,\,,\forall\,a\in\mathbb R$$
Note: The question was asked in a maths competition where the syllabus doesn't include ODE with complex functions as a solution or complex analysis.
Hint You've already found that $$e^{2 x} y(x) = \int_0^x \frac{e^{2 t} \,dt}{1 + t^2} + C$$ for some $C$. The integrand has no closed-form antiderivative in terms of elementary functions---the exponential integral function $\operatorname{Ei}$ or its equivalent is necessary---but we don't need to evaluate the integral to compute the limit.
Evaluating both sides at $x = 0$ gives $C = a$, hence $$y(x) = \frac{a + \displaystyle \int_0^x \frac{e^{2 t} \,dt}{1 + t^2}}{e^{2 x}} .$$ The denominator approaches $+\infty$ as $x \to +\infty$, so if we can show that the numerator also approaches $+\infty$ as $x \to +\infty$, we can apply l'Hôpital's Rule to compute the limit.