<s>[INST] 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.
 [/INST] 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$. 
</s>