login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for ExampleIntegration2 revision 1 of 2

1 2
Editor: test1
Time: 2024/09/02 16:09:58 GMT+0
Note:

changed:
-
Here we show how FriCAS can help solving calculus problems.
Task is: find integer n, $60 < n < 100$ such that x^n/(x^120 - 1)
has simple integral.

Theory of integration of rational functions says that integral
is sum of constant multiples of logarithms of factors of x^120 - 1.  We write
x^120 - 1 as product of four factor:
\begin{axiom}
)set output tex off
)set output algebra on
(x^30 + 1)*(x^30 - 1)*(x^30 + %i)*(x^30 - %i)
\end{axiom}

Parametric form of integral corresopnding to those factors is
and its derivative are:
\begin{axiom}
ii := a*log(x^30 - 1) + b*log(x^30 + 1) + c*log(x^30 + %i) + d*log(x^30 -%i)
f := D(ii, x)
\end{axiom}

We see that f is a linear combination of powers of x divided by x^120 - 1.  The
only power in rage is x^89.  So we need to find a, b, c, d such that
coefficients of other powers are zero.  To do this we extract coefficients
and solve relevant system of equation.  As a first step is it convenient
to convert f to a rational function with coefficient being complx polynomials,
then the other steps are easy:
\begin{axiom}
-- convert to rational function
rf := f::FRAC(POLY(COMPLEX(INT)))
-- extract numerator and coefficients of powers of x
nf := numer(rf)
lc := coefficients(univariate(nf, x))

-- solve systme of linear equations
sl := solve([lc(1), lc(2) - 1, lc(3), lc(4)], [a, b, c, d])
\end{axiom}

Finally we check obtaine result:
\begin{axiom}
ii1 := eval(ii, sl(1))
D(ii1, x)
\end{axiom}

Problem solved.


Here we show how FriCAS? can help solving calculus problems. Task is: find integer n, 60 < n < 100 such that x^n/(x^120 - 1) has simple integral.

Theory of integration of rational functions says that integral is sum of constant multiples of logarithms of factors of x^120 - 1. We write x^120 - 1 as product of four factor:

fricas
(1) -> )set output tex off
 
fricas
)set output algebra on
(x^30 + 1)*(x^30 - 1)*(x^30 + %i)*(x^30 - %i)
120 (1) x - 1
Type: Polynomial(Complex(Integer))

Parametric form of integral corresopnding to those factors is and its derivative are:

fricas
ii := a*log(x^30 - 1) + b*log(x^30 + 1) + c*log(x^30 + %i) + d*log(x^30 -%i)
30 30 30 30 (2) b log(x + 1) + c log(x + %i) + d log(x - %i) + a log(x - 1)
Type: Expression(Complex(Integer))
fricas
f := D(ii, x)
(3) 119 89 (30 d + 30 c + 30 b + 30 a)x + (30 %i d - 30 %i c - 30 b + 30 a)x + 59 29 (- 30 d - 30 c + 30 b + 30 a)x + (- 30 %i d + 30 %i c - 30 b + 30 a)x / 120 x - 1
Type: Expression(Complex(Integer))

We see that f is a linear combination of powers of x divided by x^120 - 1. The only power in rage is x^89. So we need to find a, b, c, d such that coefficients of other powers are zero. To do this we extract coefficients and solve relevant system of equation. As a first step is it convenient to convert f to a rational function with coefficient being complx polynomials, then the other steps are easy:

fricas
-- convert to rational function
rf := f::FRAC(POLY(COMPLEX(INT)))
(4) 119 89 (30 d + 30 c + 30 b + 30 a)x + (30 %i d - 30 %i c - 30 b + 30 a)x + 59 29 (- 30 d - 30 c + 30 b + 30 a)x + (- 30 %i d + 30 %i c - 30 b + 30 a)x / 120 x - 1
Type: Fraction(Polynomial(Complex(Integer)))
fricas
-- extract numerator and coefficients of powers of x
nf := numer(rf)
(5) 119 89 (30 d + 30 c + 30 b + 30 a)x + (30 %i d - 30 %i c - 30 b + 30 a)x + 59 29 (- 30 d - 30 c + 30 b + 30 a)x + (- 30 %i d + 30 %i c - 30 b + 30 a)x
Type: Polynomial(Complex(Integer))
fricas
lc := coefficients(univariate(nf, x))
(6) [30 d + 30 c + 30 b + 30 a, 30 %i d - 30 %i c - 30 b + 30 a, - 30 d - 30 c + 30 b + 30 a, - 30 %i d + 30 %i c - 30 b + 30 a]
Type: List(Polynomial(Complex(Integer)))
fricas
-- solve systme of linear equations
sl := solve([lc(1), lc(2) - 1, lc(3), lc(4)], [a, b, c, d])
1 1 %i %i (7) [[a = ---, b = - ---, c = ---, d = - ---]] 120 120 120 120
Type: List(List(Equation(Fraction(Polynomial(Complex(Integer))))))

Finally we check obtaine result:

fricas
ii1 := eval(ii, sl(1))
30 30 30 30 - log(x + 1) + %i log(x + %i) - %i log(x - %i) + log(x - 1) (8) ------------------------------------------------------------------- 120
Type: Expression(Complex(Integer))
fricas
D(ii1, x)
89 x (9) -------- 120 x - 1
Type: Expression(Complex(Integer))

Problem solved.