# Tema 2
02-3. Polinomios y fracciones racionales

kill(all)$

## Polinomios

P1:a0+a1*x;       
P2:b0+b1*x+b2*x^2;        
P3:c0+c1*x+c2*x^2+c3*x^3;

P1 = P1:a0+a1*x;     
P2 = P2:b0+b1*x+b2*x^2;        
P3 = P3:c0+c1*x+c2*x^2+c3*x^3;

P1 + P2;        P1+P3;

ratsimp(P1 + P2);       ratsimp(P1 + P3);

P1*P2;

P1*P3;

ratsimp(P1*P2);

ratsimp(P1*P3);

P4:C*(x-a1)*(x-a2)^2;

ratsimp(P4);

kill(all)$

P1:x^2-4;        
P2:x^3-x^2-x+1;

P1 + P2;        P1 - P2;

P1*P2;

expand(P1*P2);

3*P1-5*P2;

expand(3*P1-5*P2);

P3:x^6-1;

factor(P3);

allroots(P1);       allroots(P2);

factor(P2);

divide(P2,P1);          
divide(x^4-x^3+x-1, x+1);           
divide(x^4-x^3+x-1, x+2);

gcd(x^2-2*x+1, x^2-1);

load(functs)$

 lcm(x^2-2*x, x^2-3*x);

## Fracciones racionales

kill(all)$

P1:x^2-4;        
P2:x^3-x^2-x+1;

P1/P2;

P1/P2 = partfrac(P1/P2, x);

Q1:x^2-2*x+4;   
Q2:x^8+5*x^7+13*x^6+22*x^5+26*x^4+22*x^3+13*x^2+5*x+1;

'(Q1/Q2) = partfrac(Q1/Q2, x);

Q3:x+1;         
Q4:(x-a)*(x^2-b^2);

Q3/Q4 = partfrac(Q3/Q4, x);