# How to find only positive root of a polynomial

8 views (last 30 days)
Atom on 16 Apr 2013
How to find only positive root of a polynomial equation x^4+7*x^2-A=0 where A is varying from 1:.1:3. If rr is the positive real root, then find rr/(rr+1) for each case.
for A=1:.1:3
poly = [1 0 7 0 A];
R = roots(poly);
if isa(R,'complex') && (R<=0)
continue;
else
R/(R+1)
end
##### 2 CommentsShowHide 1 older comment
Atom on 16 Apr 2013
Yes. you are right. Please ignore the words "without solving".

Matt J on 16 Apr 2013
Edited: Matt J on 16 Apr 2013
By the quadratic formula, the largest solution for x^2 is
x^2 = (-7+ sqrt(49+4*A))/2
For positive A, this will always be positive. You can then get a positive root for x by doing
x = sqrt( (-7+ sqrt(49+4*A))/2 )
I don't know if this satisfies your requirement "without solving a polynomial equation". It doesn't seem possible that you meant this literally (see my comment above).
##### 2 CommentsShowHide 1 older comment
Matt J on 16 Apr 2013
Edited: Matt J on 16 Apr 2013
for A=1:.1:3
b=poly(3);
a=poly(1);
R = sqrt( (-b+ sqrt(b^2+4*A*a))/2/a );
R/(R+1)
end