Luca :
I'm trying to find a solution to the equation
x = a * tan (x)
on Python. Sympy seems to be able to solve this kind of equation so if I write
import sympy as sym
x = sym.Symbol('x')
sym.solveset(x/sym.tan(x) - 0.5, x)
I get the output:
{ x ∣ x∈C ∧ x − 0.5*tan(x) = 0 } ∖ ({ 2nπ | n∈Z } ∪ { 2nπ+π | n∈Z })
I know there are 3 solutions for every tangent cycle, and I don't understand what Sympy is telling me.
I would expect to find something similar to this:
smichr :
The output means "the set of all values that set the equation to zero excluding certain values involving pi." I don't think you will find a closed form solution for this but you can get numerical answers. Consider rewriting to make it better behaved:
>>> [nsolve(sin(x)-2*cos(x)*x, i).round(2) for i in (0,2,4)]
[0, 1.17, 4.6]
If you look at a plot of this you will see there are an infinite number of solutions; these are only 3 non-negative ones.