I am not sure, but I think Mathematica
use the L'Hospital's Rule to handle $0/0$ or $\infty/\infty$. For Example consider $Sin[x]/x$ which should be indeterminate at $x=0$, but it is well known that the value is $1$ (you can use the Plot
to convince yourself). The key is, at the limiting case you can replace the denominator and numerator (see the webpage for details) by their derivative, and then it becomes Cos[x]
which is 1 for x=0.
Now coming to your problem let,
a[x_, y_] := (Tan[x]^2 + 1 - Sec[x + y]^2)
b[x_, y_] := (Sin[x]^2 + Cos[x + y]^2 - 1)
then you are interested in a[x,0]/b[x,0]
which should have an answer $0/0$ for any value of x
. Now use the L'Hospital's Rule.
And then I am in a trouble. D[a[x,y],y]/D[b[x,y]
gives $Sec[x+y]^4$ which for y=0
is $Sec[x]^4$. But There can be further modification for multivariable L'Hospital's Rule which I am not aware of (I am not a mathematician, honestly) and which can lead to the answer. The limiting value always depends on how you are approaching to the point and depending on that you can get multiple answer.
Anyway, this can be one of the reasons behind getting such results. I hope someone will come up with a better answer.
Simplify
has internallyIntegrate
ed the expression and then differentiated it. $\endgroup$