Here we show how FriCAS can help solving calculus problems. Task is: find integer n, 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 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) Type: Expression(Complex(Integer))
fricas f := D(ii, 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))) Type: Fraction(Polynomial(Complex(Integer)))
fricas -- extract numerator and coefficients of powers of x nf := numer(rf) Type: Polynomial(Complex(Integer))
fricas lc := coefficients(univariate(nf, Type: List(Polynomial(Complex(Integer)))
fricas -- solve systme of linear equations sl := solve([lc(1), Type: List(List(Equation(Fraction(Polynomial(Complex(Integer))))))
Finally we check obtaine result: fricas ii1 := eval(ii, Type: Expression(Complex(Integer))
fricas D(ii1, Type: Expression(Complex(Integer))
Problem solved. |