\(tan^2\left(x-a\right)+tan^2\left(x+a\right)=\frac{sin^2\left(x-a\right)}{cos^2\left(x-a\right)}+\frac{sin^2\left(x+a\right)}{cos^2\left(x+a\right)}\)
\(=\frac{sin^2\left(x-a\right).cos^2\left(x+a\right)+sin^2\left(x+a\right).cos^2\left(x-a\right)}{cos^2\left(x-a\right).cos^2\left(x+a\right)}\)
\(=\frac{\left(sin2x-sin2a\right)^2+\left(sin2x+sin2a\right)^2}{\left(cos2x+cos2a\right)^2}\)
\(=\frac{sin^22x-2sin2x.sin2a+sin^22a+sin^22x+2sin2x.sin2a+sin^22a}{\left(cos2x+cos2a\right)^2}\)
\(=\frac{2\left(sin^22x+sin^22a\right)}{\left(cos2x+cos2a\right)^2}\)