Finding Tangent to the curve that passes through origin. 
Question: Find the equation of tangents at origin to the curve
$$x^{2} (a^{2}-x^{2}) = y^{2}(a^{2}+x^{2}).$$

My work: So the equation for a tangent is $$y = m(x - x_{0}) + y_{0}$$
and to find the gradient  I rearranged the the curve in terms of $y$:
$$f(x) = \sqrt{x^{2}\frac{a^2-x^2}{a^2+x^2}}$$
On differentiating I was left with the following:
$$f'(x) = -\frac{x^5+2a^2x^3-a^4x}{\sqrt{a^2-x^2}(x^2+a^2)^{\frac{3}{2}}\left | x \right |}$$
The next step that I have learned is to substitute the $x$ value (in this case $0$ as it goes through origin) to the above equation to find the gradient $m$. But that just leaves $m = 0$.
I know I am making a mistake somewhere. And there HAS to be an easier way to solve this but I am stuck here.
 A: We assume $a>0$. Your curve is
$$ y^2 = x^2 g^2(x),$$
where $g(x) = \sqrt{\frac{a^2-x^2}{a^2+x^2}}$ (we consider only $-a<x<a$, so $g$ is well-defined). Then around $(0,0)$, your curves is a union of two graphs:
$$ y = x g(x), \ \ \ y = -x g(x).$$
Differentiating and set $x=0$, one has
$$ y'(0) = g(0) = 1, \ \ \ y'(0) = -g(0) = -1.$$
Thus the two tangents are $y = x$ and $y=-x$.
A: Solving without calculation of the derivative.
In order for a straight line to be tangent to a curve at a point $O(0,0)$ it is enough to solve the system:
$x^{2} (a^{2}-x^{2}) = y^{2}(a^{2}+x^{2})$,
$y=m x$.
Substituting $m x$ instead of $y$ in the first equation, we get a second-degree equation in $x$ and $m$.
Solving for $x$, we impose that the discriminant, which will be a function of $m$, is null, so that the point is a double point.
Namely
$\Delta=1-m^{2}=0$.
Then there are two tangent lines:
$y=x$ and $y=-x$.
The value of $x$ is:
$x=\frac{a\sqrt{1-m^{2}}}{\sqrt{1+m^{2}}}$.
Imposing $\Delta=$0 does not imply the $a$ parameter.
The condition that the point is a double point does not depend on the parameter $a$.
