# Maxima kroz primjere

## Integriranje

### Neodreðeni integral

integrate((2*x+1)/(x-1),x);

integrate(1/((x-1)*(x+2)*(x-3)),x);

integrate((3*x+2)/(x^2+3*x+10)^2,x);

integrate(sin(x)/(5+cos(x)),x);

integrate(cos(x)^2,x);

integrate(x*sqrt((x-1)/(x+1)),x);

### Odreðeni integral

integrate(x^3-6*x^2+8*x,x,0,2);

integrate(sqrt(25-x^2),x,3,5);

integrate(4/cos(x)^2,x,%pi/6,%pi/3);

## Crtanje grafova funkcija

wxplot2d([x^3-6*x^2+8*x], [x,-1,5]);

wxplot2d([6*x-x^2,x^2-2*x], [x,-1,5]),wxplot_size=[400,400];

wxplot2d([x*sin(x)], [x,-5*%pi,5*%pi],[gnuplot_preamble, "set size ratio 1;"]);

load(draw);

wxdraw2d(explicit(x^3,x,-1,1),

       xaxis       = true,

       xaxis_color = blue,

       yaxis       = true,

       yaxis_width = 2,

       yaxis_type  = solid,

       yaxis_color = "#f3b507");

wxdraw2d(fill_color  = grey,

       filled_func = 6*x-x^2,explicit(x^2-2*x,x,-1,5),xaxis = true,yaxis = true);

Crtanje podruèja omeðenog s dvije funkcije

Primjer 1

f1: 6*x-x^2;

f2: x^2-2*x;

solve(f1=f2);

[x1,x2]: map('rhs, solve(f1=f2));

wxdraw2d(title       = "Podrucje izmedu 6x-x^2 i x^2-2x",

       fill_color  = grey,

       filled_func = f2,

       explicit(f1,x,x1,x2),

       filled_func = false,

       xaxis       = true,

       xtics_axis  = true,

       yaxis       = true,

       line_width  = 2,

       key         = string(f1),

       color       = red,

       explicit(f1,x,-1,5),

       key         = string(f2),

       color       = blue,

       explicit(f2,x,-1,5) );

Primjer 2

f3: x^3-6*x^2+8*x;
f4: 0;
[x1,x2,x3]: map('rhs, solve(f3=f4));

wxdraw2d(title       = "Podrucje izmedu x^3-6*x^2+8*x i x-osi",

       fill_color  = grey,

       filled_func = f3,

       explicit(f3,x,x1,x2),

       filled_func = false,

       xaxis       = true,

       xtics_axis  = true,

       yaxis       = true,

       line_width  = 2,

       key         = string(f1),

       color       = red,

       explicit(f3,x,-1,5),

       key         = string(f2),

       color       = blue,

       explicit(f4,x,-1,5) );

z:solve(f3=f4)[1];