Treating x^2/y^2 as variable r, with x/y as its square root:
syms r
s=solve(r+1/r==254);
for i=1:2
r=s(i)
eval(r)
eval(sqrt(r))
eval(sqrt(r)^5+sqrt(1/r)^5)
disp(' ')
end
output annotation
r =
127 - 48*7^(1/2) x^2/y^2
ans =
0.00393706889964562 evaluated
ans =
0.0627460668061802 x/y
ans =
1028176.00000394 (x/y)^5 + (y/x)^5
r =
48*7^(1/2) + 127 x^2/y^2
ans =
253.9960629311 evaluated
ans =
15.9372539331938 x/y
ans =
1028176 (x/y)^5 + (y/x)^5
answer: 1028176
and remaining symbolic
Completely symbolic version:
simplify(sqrt(r)^5+sqrt(1/r)^5)
gives the same answer, 1028176, without the eval().
|
Posted by Charlie
on 2024-06-05 06:04:18 |