1340ShowB10.mws
Thu Nov 10 13:42:07 MST 2005
| > | restart; with(plots, display); |
###############################################
Write a procedure to take a polynomial and an interval and plot the polynomial on the interval and give a list of the zeros for the polynomial on the interval.
| > | EEE := proc(ff,XXX) description "Utah!"; plot(ff,XXX); [fsolve( ff(t) = 0, t=XXX)]; end; |
| > |
| > | EEE(w -> (w^2 - 5)*(w-3/2), 0..3); |
| > | #2.236067977^2; |
| > |
| > | FFF := proc(ff,XXX) description "Utah!"; local P, Z; P := plot(ff,XXX); Z := [fsolve( ff(t) = 0, t=XXX)]; return(P,Z, D(ff)); end; |
| > |
| > | #Z := 15; P := -3; |
| > | Pf, Zros, DDDD:= FFF(w -> (w^2 - 5)*(w-3/2), 0..3): |
| > | #Z; P; DDDD(u); |
| > | display(Pf); Zros; DDDD(x); |
| > |
| > | Pf, Zros, DDDD:= FFF(w -> w^4+9, -3..3): |
| > |
| > | display(Pf); Zros; DDDD(x); |
########################################################
| > | tyee := proc(N,K) local SS, n, k; SS := 0; n := N; k := K; while(k >= 0) do SS := SS + binomial(n,k); k := k - 1; #print(k); end do; return(SS); end: |
| > |
| > | x := tyee(4,4): |
| > | y := tyee(5,2): |
| > | x+y; |
| > | ################################################# |
| > | Sum( (-1)^k/(2*k+1), k = 0..infinity); |
| > | value(%); |
| > | Sum( 1/k^2, k = 1..infinity); |
| > | value(%); |
| > | ####################################################333 |
| > | x := 'x'; |
| > | A := 1; f := sqrt; |
| > | series( f(x), x=A, 5); |
| > | PPP := convert(%, polynom); |
| > | display( plot(PPP, x=0..4), plot(f,0..4, color=BLACK)); |
| > |
| > |
| > |