Is it possible to solve for $\theta$ in this multivariable equation? Question: Given the equation $$c^2=a^2+(\frac{pq}{\sqrt{q^2\sin^2{\theta}+p^2\cos^2{\theta}}})^2-2a\frac{pq}{\sqrt{q^2\sin^2{\theta}+p^2\cos^2{\theta}}}\cos{\theta},$$
is it possible to solve for $\theta$ in terms of $a,c,p,$ and $q$?
Original Problem: I am attempting to develop an algorithm to solve an extension of a spherical codes problem. This image shows a partial cutaway of a spherical codes solution (a center sphere with as many smaller spheres packed onto it as possible, cut away to show the inner sphere). 
I'd like to extend this problem to ellipsoids, so essentially to take an ellipsoid with given dimensions and pack as many spheres of another given dimension on its surface as possible. The equation above is a central part of my solution to this problem, and is derived from the law of cosines with $\theta$ as the opposite angle to side $c$ and the side $b$ substituted by the large fraction ($\frac{pq}{...}$).
Attempts: I've plugged the equation into Matlab's solve feature, Mathematica's Reduce function (both to no avail), and Mathematica's Solve function , which returned this:

$x = \arccos{\sqrt{(-((a^2 p^2 pq^2)/(a^4 p^4 - 2 a^2 c^2 p^4 + 
          c^4 p^4 - 4 a^2 p^2 pq^2 - 2 a^4 p^2 q^2 + 
          4 a^2 c^2 p^2 q^2 - 2 c^4 p^2 q^2 + 4 a^2 pq^2 q^2 + 
          a^4 q^4 - 2 a^2 c^2 q^4 + 
          c^4 q^4)) + (c^2 p^2 pq^2)/(a^4 p^4 - 2 a^2 c^2 p^4 + 
        c^4 p^4 - 4 a^2 p^2 pq^2 - 2 a^4 p^2 q^2...}}$ (truncated, else it would continue for 21 total lines)

However, after substituting variables into the full expression above, I determined that it too returned false values (e.g. $\arccos(n)$ where $n>1$).
I was wondering if there is a way to solve this by hand or if it is impossible to do so? Thank you in advance.
 A: EDIT: After the OP has been edited, there is no hope to find a closed form solution, since you are likely to obtain at least fourth degree powers in $\cos\theta$ when squaring :(
First try to isolate the $\theta$:
$$\frac{c^2-a^2}{pq}=\frac{1-2a\cos \theta}{\sqrt{q^2 \sin^2\theta+p^2\cos^2\theta}}$$
now take squares in both sides and substitute the $\sin\theta$:
$$\left(\frac{c^2-a^2}{pq}\right)^2=\frac{1-4a\cos \theta+4a^2\cos^2\theta}{q^2 \sin^2\theta+p^2\cos^2\theta}=\frac{1-4a\cos \theta+4a^2\cos^2\theta}{q^2 +(p^2-q^2)\cos^2\theta}$$
Let us call $k$ the left hand side for brevity, multiply:
$$kq^2+k(p^2-q^2)\cos^2\theta=1-4a\cos \theta+4a^2\cos^2\theta$$
and group:
$$\left(k(p^2-q^2)-4a^2\right)\cos^2\theta + 4a\cos \theta+(kq^2-1)=0$$
Can you take it from here? It is a standard second degree equation in $\cos\theta$. 
A: For this problem, I should write two equations
$$c^2=a^2+x^2-2ax \cos(\theta) \tag 1$$
$$x=\frac{pq}{\sqrt{q^2 \sin^2(\theta)+p^2\cos^2(\theta)}}\tag 2$$ From $(1)$ we get $$\cos(\theta)=\frac{a^2-c^2+x^2}{2 a x}\tag 3$$ Replacing in $(2)$, squaring, simplifying and so on, we end with $$Ax^4+Bx^2+C=0\tag 4$$ (which is a "simple" quadratic equation in $x^2$) where $$A=q^2-p^2$$ 
$$B=-2 \left(q^2 \left(a^2+c^2\right)+p^2 (a^2-c^2) \right)$$ $$C=q^2 \left(\left(a^2-c^2\right)^2+4 a^2 p^2\right)-p^2 \left(a^2-c^2\right)^2$$ For the quadratic, we have $$\Delta=B^2-4AC=16a^2q^2\left(a^2p^2+(p^2-c^2)(p^2-q^2)\right)$$ then $x$ and, back to $(3)$, $\cos(\theta)$ and $\theta$.
