The presence of trigonometric functions makes the system difficult to solve, even though it appears to be a "simple" one.
One approach to easily find the solutions of a system that includes terms of the form cos(x)
and/or sin(x)
is to perform the substitution u=cos(x)
, v=sin(x)
, introduce the additional equation u**2 + v**2 == 1
, and solve for u
, v
. Variable x
can then be obtained from the value(s) of u
.
import sympy as sp
A, u, v, phi = sp.symbols('A, u, v, phi', real = True)
eqs = [sp.Eq(A * u, 1), sp.Eq(-A * v/2, 0), sp.Eq(u**2 + v**2, 1)]
sol = sp.solve(eqs, [A, u, v])
print (sol)
[(-1, -1, 0), (1, 1, 0)]
It follows that A
can take two values (-1
, 1
). For A=-1
it must hold u==-1
, which corresponds to an infinite number of values of phi
as follows
sp.solveset(sp.Eq(sp.cos(phi),-1), phi)
ImageSet(Lambda(_n, 2*_n*pi + pi), Integers())
The procedure is similar for A=1
.