MATLAB: Algebric equation for real variables

algebracomplexpolynomial

I have a polynomial with a variable coefficient. Given the arguement of complex root of the polynomial, I need to find the value of that coefficient. How do I put this in functions like solve to get an answer?.
NOTE: All coefficients are real including the variable one.
example : (3x+1)(4x+2) + K(5x+3)
arg(x) = imag(x)/real(x) = 0.5
find K

Best Answer

Suppose the complex argument of the root is designated by A. Then the complex root is x = r*exp(i*A) for some real-valued r. Substitute that x into your polynomial. The real() and the imag() of the result both have to be zero. Assuming you have only a single variable argument, say V, then you would
syms r real
Pv = subs(YourPolynomial, x, r*exp(i*A)));
solve(real(Pv), imag(Pv), [r V])
For example
syms x V pi
A = 3*pi/7;
YourPolynomial = x^3 - V * x^2 + 2 * x - 1;
syms r
Pv = subs(YourPolynomial, x, r*exp(i*A));
sol = solve(real(Pv), imag(Pv), [r V]);