Finding angle of irregular quadrilateral given all sides and one angle Given the lengths of all sides of a (non-intersecting) quadrilateral and one angle $\alpha_1$, I need to find the two possible solutions of the angle next to the given angle $\alpha_1$, named $\alpha_2$ as illustrated here. 
Strangely enough, I couldn't find an answer myself nor on the internet. Here is what I've tried so far:
Call the length of the diagonal from $\alpha_1$ to $\theta_1$ $p$ and the length of the diagonal from $\alpha_2$ to $\theta_2$ $q$. I tried using both the cosine rule and the generalization of Ptolemy's theorem found on wikipedia to find an expression:
\begin{align}
p^2 &= l^2 + d^2 -2ld\cos(\theta_2) = l^2 + D^2 -2lD\cos(\alpha_2) \\
q^2 &= l^2 + d^2 -2ld\cos(\theta_1) = l^2 + D^2 -2lD\cos(\alpha_1) \\
p^2q^2 &= l^4 + d^2D^2 - l^2dD\cos(\alpha_1 + \theta_1) = l^4 + d^2D^2 - l^2dD\cos(\alpha_2 + \theta_2)\text{.}
\end{align}
I manipulated these equations into the following form:
\begin{align}
\cos(\theta_2) &= \frac{d^2-D^2+2lD\cos(\alpha_2)}{2ld} \\
\cos(\theta_1) &= \frac{d^2-D^2+2lD\cos(\alpha_1)}{2ld} \\
\cos(\alpha_2 + \theta_2) &= \cos(\alpha_1 + \theta_1)\text{.}
\end{align}
Trying to go further, it seems I'm not able to find an analytical solution. For example the third equation implies that either $\alpha_2 + \theta_2 = \alpha_1 + \theta_1 + 2\pi k$ or $\alpha_2 + \theta_2 = -\alpha_1 - \theta_1 + 2\pi k$ for some $k \in \mathbb{Z}$, but because $\theta_2$ is some non-linear function of $\alpha_2$, I get stuck there.
Does an analytical solution exist? If yes, then how can I find one?
Edit: thanks to Paul Castle I was able to get an expression for $\cos{\alpha_2}$ (with $A = \cos(\alpha_1+\theta_1)$):
\begin{equation}
\left(\frac{D^2}{d^2}+1\right)\cos^2{\alpha_2} + \left(\frac{D(d^2-D^2)}{ld^2}-2A\right)\cos \alpha_2+A^2 + \frac{(d^2-D^2)^2}{4l^2d^2}-1 = 0\text{.}
\end{equation}
This gives a discriminant
\begin{equation}
\Delta = 4\left(1 - \left(\frac{D}{d}A+\frac{d^2-D^2}{2ld}\right)^2\right)\text{.}
\end{equation}
Now I'm not sure how to continue. Can I safely assume $\Delta$ may not be less than zero, because this won't yield any solutions? Can I assume something simular for the other cases to make my life easier?
 A: You can solve the second equation for $\theta_1$. Then expand the third equation to 
$$\cos (\alpha_1 + \theta_1) = \cos \alpha_2 \cos \theta_2 - \sin \alpha_2 \sin \theta_2.$$
Then plug in the first equation:
$$\cos (\alpha_1 + \theta_1) = \cos \alpha_2 \frac{d^2-D^2+2lD\cos(\alpha_2)}{2ld} - \sin \alpha_2 \sqrt{1 - \left( \frac{d^2-D^2+2lD\cos(\alpha_2)}{2ld} \right)^2}.$$
Rearrange to isolate the square root, then square to get a polynomial that you can solve for $\cos \alpha_2$. 
A: From the cosine rule we can compute $q$:
$$
q^2 = l^2 + D^2 -2lD\cos\alpha_1.
$$
Let then $\phi$ be the angle formed by diagonal $q$ and side $D$ and $\phi'$ be the angle formed by diagonal $q$ and right side $l$ (so that you have either $\alpha_2=\phi+\phi'$ or $\alpha_2=\phi-\phi'$). Using again the cosine rule we can find $\phi$ and $\phi'$:
$$
\cos\phi={q^2+D^2-l^2\over 2Dq},
\quad
\cos\phi'={q^2+l^2-d^2\over 2lq}.
$$
You then have the solution $\alpha_2=\phi+\phi'$ and, if $\phi'<\phi$, a second solution $\alpha_2=\phi-\phi'$. If instead $\phi'>\phi$ the corresponding quadrilateral is self-intersecting.
