Consider the following function $$g(x,y):= \frac{1}{( (1+y)^2+x^2 )( 1+ax^2y^2 )^2}$$, where I assume that $y\geq 0$ and $a\in (0,1]$ is a parameter. When I try to evaluate the integral $\int g(x,y)\,dx$ using Mathematica I get the following result:
$$ \frac{\frac{axy^2(-1 + ay^2(1 + y)^2)}{(1 + ax^2y^2)} + \sqrt{a}y(-3 + ay^2(1 + y)^2)\arctan(\sqrt{a}xy) + \frac{2\arctan(\frac{x}{1 + y} )}{ 1 + y} }{2(-1 + ay^2(1 + y)^2)^2} $$ This result cannot be the correct primitive of $g(\cdot,y)$, since on the one hand the denominator is always has a positive root but the numerator is positive, and on the other hand we have that $$0\leq g(x,y)\leq \frac{1}{1+x^2 }$$ which implies that $g(\cdot,y)$ is Riemann integrable for all $y\geq 0$.
Could someone please tele me how to obtain a correct answer to the problem? This would be very much appreciated!
Code:
Integrate[1/(((1+y)^2+x^2)*(1+a*x^2*y^2)^2),x]
Output:
((a x y^2 (-1 + a y^2 (1 + y)^2))/(1 + a x^2 y^2) + Sqrt[a] y (-3 + a y^2 (1 + y)^2) ArcTan[Sqrt[a] x y] + ( 2 ArcTan[x/(1 + y)])/(1 + y))/(2 (-1 + a y^2 (1 + y)^2)^2)
D[%,x]
gives the expected result. $\endgroup$