eqn =
syms x a b
eqn = x^2 + 2*x + 5 == (b+4*a)*x^2 + (5*a+b)*x + (-b+2*a)
cleft = coeffs(lhs(eqn),x,'all')
cright = coeffs(rhs(eqn),x,'all')
sol = solve(cleft == cright,[a b])
Verify
isAlways(subs(eqn,sol))
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!