load(draw)$

## Limes funkcije

Napomena. U svakom zadatku su prije racunanja limesa definirane funkcije zasebno, 
kako biste zorno jasnije vidjeli o kojoj se funkciji radi. Naravno da nema potrebe funkciju
zasebno definirati, moze se njezina formula direktno unositi u naredbu "limit".

1. zadatak

f(x):=(sqrt(x)+1)/(1-x);

limit(f(x),x,5);

2. zadatak

f(x):=(sqrt(1+2*x)-3)/(sqrt(x)-2);

limit(f(x),x,inf);

3. zadatak

f(x):=(x^(1/2)+x^(1/3)+x^(1/4))/(4*x-3)^(1/2);

limit(f(x),x,inf);

4. zadatak

f(x):=(x+3)/(9-x^2);

limit(f(x),x,-3);

wxplot2d([(x+3)/(9-x^2)], [x,-5,6],[y,-10,10])$

5. zadatak

f(x):=(x^2-x-12)/(x-4);

limit(f(x),x,4);

6. zadatak

f(x):=(x^3-27)/(x^2-9);

limit(f(x),x,3);

wxplot2d([(x^3-27)/(x^2-9)], [x,-5,6],[y,-2,20])$

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",line_width=3,color=blue,
xtics=[-4,1,6],ytics=[-2,1,20],explicit((x^3-27)/(x^2-9),x,-5,6),line_width=1.5,color=red,
explicit(4.5,x,-5,3),parametric(3,t,t,-2,4.5),point_type=filled_circle,point_size=1.5,
points([[3,4.5]]),yrange=[-2,20]),wxplot_size=[800,500];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",line_width=3,color=blue,
xtics=[-4,1,6],ytics=[-2,0.5,20],explicit((x^3-27)/(x^2-9),x,-5,6),line_width=1.5,color=red,
explicit(4.5,x,-5,3),parametric(3,t,t,-2,4.5),point_type=filled_circle,point_size=1.5,
points([[3,4.5]]),yrange=[-2,20]);

7. zadatak

f(x):=(x^2+x-2)/(x-1)^2;

limit(f(x),x,1);

limes sa lijeva

limit(f(x),x,1,minus);

limes zdesna

limit(f(x),x,1,plus);

wxplot2d([(x^2+x-2)/(x-1)^2], [x,-5,6],[y,-10,10])$

8. zadatak

f(x):=(x^3-3*x^2-4*x+12)/(x^2-5*x+6);

limit(f(x),x,3);

9. zadatak

f(x):=(sqrt(x)-2)/(4-x);

limit(f(x),x,4);

10. zadatak

f(x):=(sqrt(1+2*x)-3)/(sqrt(x)-2);

limit(f(x),x,4);

11. zadatak

f(x):=sqrt(x-2)/(x^2-4);

limit(f(x),x,2,plus);

12. zadatak

f(x):=sin(7*x)/x;

limit(f(x),x,0);

13. zadatak

f(x):=(1-cos(x))/(2*x^2);

limit(f(x),x,0);

14. zadatak

f(x):=tan(%pi*x)/(x+4);

limit(f(x),x,-4);

15. zadatak

f(x):=(cos(2*x)-cos(4))/(14*x+28);

limit(f(x),x,-2);

trigreduce(%);

16. zadatak

f(x):=((x+1)/(x-2))^(3*x+1);

limit(f(x),x,inf);

17. zadatak

f(x):=(1+1/4*x)^(1/x);

limit(f(x),x,0);

18. zadatak

f(x):=(2^x+5^x)/(5^x-4^x);

limit(f(x),x,inf);

19. zadatak

f(x):=(3^x-12^x)/x;

limit(f(x),x,0);

logcontract(%);

20. zadatak

f(x):=(log(1+x)/log(10)-log(2)/log(10))/(x-1);

limit(f(x),x,1);

21. zadatak

f(x):=((x^2+2)/(x^2+5))^((x^2+3)/3);

limit(f(x),x,0);

22. zadatak

f(x):=log(x+2)/(x+1);

limit(f(x),x,-1);

23. zadatak

f(x):=(45^(x+1)-1)/(3*x+3);

limit(f(x),x,-1);

24. zadatak

f(x):=(%e^(x+3)-%e)/(x+2);

limit(f(x),x,-2);

25. zadatak

f(x):=(x-1)/log(x);

limit(f(x),x,1);

26. zadatak - limes ne postoji (funkcija ne odlazi u beskonacno, ali oscilira)

limit(sin(x),x,inf);

## Vrste prekida

1. zadatak (uklonjiv prekid prve vrste)

f(x):=(-x^2+5*x-6)/(2-x);

limit(f(x),x,2,minus);

limit(f(x),x,2,plus);

wxplot2d([(-x^2+5*x-6)/(2-x),[discrete,[[2,-1]]]], [x,-2,5],[y,-6,4],grid2d,
[style, [lines,3],[points]],[point_type, bullet],[legend,false])$

2. zadatak (neuklonjiv prekid prve vrste)

f(x):=(x-7)/abs(x-7);

limit(f(x),x,7,minus);

limit(f(x),x,7,plus);

wxplot2d([(x-7)/abs(x-7),[discrete,[[7,-1],[7,1]]]], [x,-1,10],[y,-6,4],grid2d,
[style, [lines,3],points],[point_type,bullet],[legend,false])$

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-1,1,15],ytics=[-6,1,4],line_width=3,color=blue,
explicit(-1,x,-1,7), explicit(1,x,7,15),color=red,point_type=filled_circle,point_size=1.5,
points([[7,-1],[7,1]]),yrange=[-6,4]),wxplot_size=[600,400];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-1,1,15],ytics=[-6,1,4],line_width=3,color=blue,
explicit(-1,x,-1,7), explicit(1,x,7,15),color=red,point_type=filled_circle,point_size=1.5,
points([[7,-1],[7,1]]),yrange=[-6,4]);

3. zadatak (prekid druge vrste)

f(x):=4/(x-1);

limit(f(x),x,1,minus);

limit(f(x),x,1,plus);

wxplot2d([4/(x-1)], [x,-1,3],[y,-60,60],grid2d,
[style, [lines,3]])$

4. zadatak (neuklonjiv prekid prve vrste)

f(x):=1/(4+%e^(1/x));

limit(f(x),x,0,minus);

limit(f(x),x,0,plus);

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,7],ytics=[-0.1,0.1,0.3],
line_width=3,color=blue,explicit(1/(4+%e^(1/x)),x,-3,-0.01),explicit(1/(4+%e^(1/x)),x,0.01,7),
yrange=[-0.2,0.4]),wxplot_size=[600,400];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,7],ytics=[-0.1,0.1,0.3],
line_width=3,color=blue,explicit(1/(4+%e^(1/x)),x,-3,-0.01),explicit(1/(4+%e^(1/x)),x,0.01,7),
yrange=[-0.2,0.4]);

5. zadatak (neuklonjiv prekid prve vrste)

f(x):=sqrt(1+cos(2*x))/(sqrt(%pi)-sqrt(2*x));

limit(f(x),x,%pi/2,minus);

limit(f(x),x,%pi/2,plus);

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[0,1,7],ytics=[-3,1,3],
line_width=3,color=blue,explicit(f(x),x,0,1.57),explicit(f(x),x,1.58,7),
color=black,line_width=2,line_type=dots,parametric(%pi/2,t,t,-sqrt(2*%pi),sqrt(2*%pi)),
yrange=[-3,3]),wxplot_size=[600,400];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[0,1,7],ytics=[-3,1,3],
line_width=3,color=blue,explicit(f(x),x,0,1.57),explicit(f(x),x,1.58,7),
color=black,line_width=2,line_type=dots,parametric(%pi/2,t,t,-sqrt(2*%pi),sqrt(2*%pi)),
yrange=[-3,3]);

6. zadatak (prekid druge vrste)

f(x):=%e^(1/x);

limit(f(x),x,0,minus);

limit(f(x),x,0,plus);

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,3],ytics=[0,2,20],
line_width=3,color=blue,explicit(f(x),x,-3,-0.01),explicit(f(x),x,0.01,3),
yrange=[-1,20]),wxplot_size=[600,400];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,3],ytics=[0,2,20],
line_width=3,color=blue,explicit(f(x),x,-3,-0.01),explicit(f(x),x,0.01,3),
yrange=[-1,20]);

7. zadatak (prekid druge vrste)

f(x):=%e^(1/x^2);

limit(f(x),x,0,minus);

limit(f(x),x,0,plus);

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,3],ytics=[0,2,20],
line_width=3,color=blue,explicit(f(x),x,-3,3),
yrange=[-1,20]),wxplot_size=[600,400];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,3],ytics=[0,2,20],
line_width=3,color=blue,explicit(f(x),x,-3,3),
yrange=[-1,20]);

8. zadatak (uklonjiv prekid prve vrste)

f(x):=%e^(-1/x^2);

limit(f(x),x,0,minus);

limit(f(x),x,0,plus);

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-5,1,5],ytics=[0,0.1,1],
line_width=3,color=blue,explicit(f(x),x,-5,5),color=red,
point_type=filled_circle,point_size=1.5,points([[0,0]]),
yrange=[-0.1,1]),wxplot_size=[600,400];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-5,1,5],ytics=[0,0.1,1],
line_width=3,color=blue,explicit(f(x),x,-5,5),color=red,
point_type=filled_circle,point_size=1.5,points([[0,0]]),
yrange=[-0.1,1]),wxplot_size=[600,400];

9. zadatak (prekid druge vrste)

f(x):=sin(1/x);

oba jednostrana limesa osciliraju u okolini nule

limit(f(x),x,0,minus);

limit(f(x),x,0,plus);

wxdraw2d(grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,3],ytics=[-1.2,0.2,1.2],
line_width=3,color=blue,explicit(f(x),x,-3,3),
yrange=[-1.2,1.2]),wxplot_size=[600,400];

draw2d(terminal=wxt,grid=true,xaxis=true,xaxis_width=1,xaxis_type=solid,xlabel="x",
yaxis=true,yaxis_width=1,yaxis_type=solid,ylabel="y",xtics=[-3,1,3],ytics=[-1.2,0.2,1.2],
line_width=3,color=blue,explicit(f(x),x,-3,3),
yrange=[-1.2,1.2]),wxplot_size=[600,400];