solve for x if l^2=x^2+d^2+x^2+(l-d)^2-2sqrt((x^2+d^2)(x^2+(l-d)^2))*cos(theta)