Find the integral of ;
2 views (last 30 days)
Show older comments
(X^2-29x+5)÷{(x-4)(x^2+3)}
2 Comments
Dyuman Joshi
on 23 Oct 2023
Never thought I'd see a day when someone named Newton would ask a calculus question, which is unrelated to the forum on which the question is asked.
Walter Roberson
on 23 Oct 2023
The integral over what range? The symbolic integral has 3 distinct ranges (two discontinuities) and getting the phase right can be difficult.
Answers (1)
Sam Chak
on 23 Oct 2023
Hello Sir @Newton
I feel honored to have the opportunity to solve this integral problem for you in the modern computational era.
% Plotting the rational function
x1 = -30:0.00001:4;
x2 = 4:0.00001:30;
f = @(x) (x.^2 - 29*x + 5)./((x - 4).*(x.^2 + 3));
plot(x1, f(x1), 'color', '#0d6ea3'), hold on
plot(x2, f(x2), 'color', '#0d6ea3'), ylim([-10 10])
xline(4, '-.r', 'x = 4'), grid on
xlabel('x'), ylabel('f(x)')
% defining the expression
syms x real
expr = (x^2 - 29*x + 5)/((x - 4)*(x^2 + 3))
% performing partial fraction decomposition
expr = partfrac(expr, x)
% finding the indefinite integral
F = int(expr)
4 Comments
David Goodmanson
on 25 Oct 2023
Actually the integral can be found even if the bounds cross 4, assuming the principal value is taken. From both Walter's result and SC's partial fraction expresson it's clear that the only part of the integrand that involves crossing 4 is
-5/(x-4)
whose itegral is
-5* [ log(UB-4) -log(LB-4) ]
If LB and UB are on opposite sides of 4, then the principal value is
-5* lim{eps-->0) [ Int{LB, 4-eps} 1/(x-4) dx + Int{4+eps, UB} 1/(x-4) dx ]
with the only consequence being that absolute values appear in the log terms:
-5* [ (log(abs(UB-4)) -log(abs(LB-4)) ]
If the principal value is always implied, the expression just above works no matter where UB, LB are. Same side, opposite sides, both positive, both negative, doesn't matter.
Walter Roberson
on 25 Oct 2023
Testing to see what int() can do.
I find it interesting that taking the integral and substituting in bounds, gets a different representation of the result than if you take the integral supplying the bounds -- different enough that all my tests with rewrite() and simplify() were not able to get val2s - val4s to collapse to 0.
syms x LB UB real
assumeAlso(LB <= UB)
expr = (x^2 - 29*x + 5)/((x - 4)*(x^2 + 3))
assumeAlso(LB < 4)
assumeAlso(4 < UB)
val1 = int(expr, x, LB, UB, 'PrincipalValue', false)
val2 = int(expr, x, LB, UB, 'PrincipalValue', true)
val2s = simplify(subs(val2, [LB, UB], [3 5]), 'steps', 10)
val3 = int(expr, x, 3, 5, 'PrincipalValue', false)
val4 = int(expr, x, 3, 5, 'PrincipalValue', true)
val4s = simplify(val4, 'steps', 10)
val2s - val4s
simplify(ans, 'steps', 25)
vpa(ans)
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!















