Both A and B serve as hypotenuses to two right triangles. The verify that the lower left angle of both triangles is t.
In the lower right triangle: hence .
Do the same for the upper left triangle:
Combine the function that is to be optimized into
I hope this helps you get started with this problem! Good luck!