1. Visualisasi fungsi eksponen yang di dekati deret Maclaurin
x =
seq(-5,5,by=0.1)
plot
(c(-10,10),c(-2,2), type="n", xlab="X",
ylab="Eksponen", main="Aproksimasi untuk Fungsi Eksponen")
abline
(h=0,col="red")
abline
(v=0,col="black")
lines (x, exp(x),
col="red")
lines (x, x,
col="pink")
lines (x,
1+x,col="blue")
lines (x,
1+x+(x^2/factorial(2)),col="green")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3)),col="yellow")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4)),col="pink")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5)),col="black")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6)),col="steelblue")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7)),col="blueviolet")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8)),col="purple")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9)),col="brown")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9))+(x^10/factorial(10)),col="red")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9))+(x^10/factorial(10))+(x^11/factorial(11)),col="tomato4")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9))+(x^10/factorial(10))+(x^11/factorial(11))+(x^12/factorial(12)),col="violetred4")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9))+(x^10/factorial(10))+(x^11/factorial(11))+(x^12/factorial(12))+(x^13/factorial(13)),col="thistle4")
lines (x, 1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9))+(x^10/factorial(10))+(x^11/factorial(11))+(x^12/factorial(12))+(x^13/factorial(13))+(x^14/factorial(14)),col="skyblue2")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9))+(x^10/factorial(10))+(x^11/factorial(11))+(x^12/factorial(12))+(x^13/factorial(13))+(x^14/factorial(14))+(x^15/factorial(15)),col="tan")
lines (x,
1+x+(x^2/factorial(2))+(x^3/factorial(3))+(x^4/factorial(4))+(x^5/factorial(5))+(x^6/factorial(6))+(x^7/factorial(7))+(x^8/factorial(8))+(x^9/factorial(9))+(x^10/factorial(10))+(x^11/factorial(11))+(x^12/factorial(12))+(x^13/factorial(13))+(x^14/factorial(14))+(x^15/factorial(15))+(x^16/factorial(16)),col="Blue")
Jadi
berdasarkan hasil aproksimasi diatas diketahui bahwa fungsi eksponen dapat di
aproksimasi oleh deret Maclourin pada orde ke 16
2.
Visualisasi
fungsi cosinus yang di dekati deret Maclaurin
x =
seq(-10,10,by=0.1)
plot
(c(-10,10),c(-2,2), type="n", xlab="X",
ylab="Cos", main="Aproksimasi untuk Fungsi Cos")
abline
(h=0,col="blue")
abline
(v=0,col="blue")
lines (x, cos(x),
col="red")
lines (x, x,
col="yellow")
lines (x,
1-(x^2/factorial(2)), col="yellow")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4)), col="black")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6)),
col="red")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8)),
col="blue")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10)),
col="brown")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12)),
col="pink")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14)),
col="orange")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16)),
col="maroon")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16))-(x^18/factorial(18)),
col="skyblue3")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16))-(x^18/factorial(18))+(x^20/factorial(20)),
col="thistle4")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16))-(x^18/factorial(18))+(x^20/factorial(20))-(x^22/factorial(22)),
col="tomato4")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16))-(x^18/factorial(18))+(x^20/factorial(20))-(x^22/factorial(22))+(x^24/factorial(24)),
col="violetred")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16))-(x^18/factorial(18))+(x^20/factorial(20))-(x^22/factorial(22))+(x^24/factorial(24))-(x^26/factorial(26)),
col="steelblue")
lines (x,
1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16))-(x^18/factorial(18))+(x^20/factorial(20))-(x^22/factorial(22))+(x^24/factorial(24))-(x^26/factorial(26))+(x^28/factorial(28)),
col="violet")
lines (x, 1-(x^2/factorial(2))+(x^4/factorial(4))-(x^6/factorial(6))+(x^8/factorial(8))-(x^10/factorial(10))+(x^12/factorial(12))-(x^14/factorial(14))+(x^16/factorial(16))-(x^18/factorial(18))+(x^20/factorial(20))-(x^22/factorial(22))+(x^24/factorial(24))-(x^26/factorial(26))+(x^28/factorial(28))-(x^30/factorial(30)),
col="black")
Jadi
berdasarkan hasil aproksimasi diatas diketahui bahwa fungsi cos dapat di
aproksimasi oleh deret Maclourin pada orde ke 30
3.
Visualisasi
fungsi lon yang di dekati deret Maclaurin
x
= seq(-1,1,by=0.1)
plot
(c(-10,10),c(-2,2), type="n", xlab="X",
ylab="Lon", main="Aproksimasi untuk Fungsi Lon")
abline
(h=0,col="red")
abline
(v=0,col="red")
lines
(x, log(x+1), col="blue")
lines
(x, x, col="green")
lines
(x, x-(x^2/2), col="orange")
lines
(x, x-(x^2/2)+(x^3/3), col="violetred")
lines
(x, x-(x^2/2)+(x^3/3)-(x^4/4), col="tomato")
lines
(x, x-(x^2/2)+(x^3/3)-(x^4/4)+(x^5/5), col="black")
lines
(x, x-(x^2/2)+(x^3/3)-(x^4/4)+(x^5/5)-(x^6/6), col="tomato4")
lines
(x, x-(x^2/2)+(x^3/3)-(x^4/4)+(x^5/5)-(x^6/6)+(x^7/7),
col="firebrick3")
lines
(x, x-(x^2/2)+(x^3/3)-(x^4/4)+(x^5/5)-(x^6/6)+(x^7/7)-(x^8/8),
col="pink")
lines
(x, x-(x^2/2)+(x^3/3)-(x^4/4)+(x^5/5)-(x^6/6)+(x^7/7)-(x^8/8)+(x^9/9),
col="blue")
lines
(x, x-(x^2/2)+(x^3/3)-(x^4/4)+(x^5/5)-(x^6/6)+(x^7/7)-(x^8/8)+(x^9/9)-(x^10/10),
col="black")
Tidak ada komentar:
Posting Komentar