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

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.

Remark: How we knew that four factors will give solution? Trying shows that there are so solution with two factors. Similarly there are no solution with 3 factors. So, solution with four factors is the simplest one.




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: