Pada Artikel sebelumnya telah dibahas mengenai materi persamaan polinomial dan penggunaannya dengan menggunakan Fungsi polyroot di R Markdown pada Aplikasi R Studio. Artikel kali ini akan berisi solusi penyelesaian akar persamaan polinomial dari soal-soal yang akan disajikan.
1. 9^(x^3 - 4x^2 - x + 4) - 9^(x^2 + x - 6) = 0
2. 6x^3 - 11x^2 - 3x + 2 = 0
3. x^4 - 4x^2 - 5 = 0
4. x^4 - 2x^3 + 3x - 6 = 0
5. 2x^3 + 5x^2 - 8 = 0
Penyelesaiannya :
Penyelesaian Secara Manual
9^(x^3 - 4x^2 - x + 4) - 9^(x^2 + x - 6) = 0
9^(x^3 - 4x^2 - x + 4) = 9^(x^2 + x - 6)
x^3 - 4x^2 - x + 4 = x^2 + x - 6
x^3 - 6x^2 - 2x + 10 = 0
Fungsi polyroot y = x^3 - 6x^2 - 2x + 10
polyroot(c(1,-6,-2,10))
## [1] 0.1650807+0i -0.7610449+0i 0.7959642-0i
Rumus tabel
# Rumus Membuat Tabel
root_table <- function(f, a, b, N=10){
h <- abs((a+b)/N)
x <- seq(from=a, to=b, by=h)
fx <- rep(0, N+1)
for(i in 1:(N+1)){
fx[i] <- f(x[i])
}
data <- data.frame(x=x, fx=fx)
return(data)
}
Membuat Tabel
# Membuat Tabel
tabel <- root_table(f=function(x){x^3 - 6*(x^2) - 2*x + 10},
a=0, b=1, N=10)
print(tabel)
## x fx
## 1 0.0 10.000
## 2 0.1 9.741
## 3 0.2 9.368
## 4 0.3 8.887
## 5 0.4 8.304
## 6 0.5 7.625
## 7 0.6 6.856
## 8 0.7 6.003
## 9 0.8 5.072
## 10 0.9 4.069
## 11 1.0 3.000
Membuat Vektor
# Membuat Vektor
x <- c(-2:2); y <- x^3 - 6*(x^2) - 2*x + 10
Membuat Grafik
plot(x, y, type="o")
Fungsi polyroot y = 6x^3 - 11x^2 - 3x + 2
polyroot(c(6,-11,-3,2))
## [1] 0.5+0i -2.0-0i 3.0-0i
Rumus tabel
# Rumus Membuat Tabel
root_table <- function(f, a, b, N=10){
h <- abs((a+b)/N)
x <- seq(from=a, to=b, by=h)
fx <- rep(0, N+1)
for(i in 1:(N+1)){
fx[i] <- f(x[i])
}
data <- data.frame(x=x, fx=fx)
return(data)
}
Membuat Tabel
# Membuat Tabel
tabel <- root_table(f=function(x){81*(x^3) + 9*(x^2) - 9*x + 4},
a=-1, b=0, N=10)
print(tabel)
## x fx
## 1 -1.0 -59.000
## 2 -0.9 -39.659
## 3 -0.8 -24.512
## 4 -0.7 -13.073
## 5 -0.6 -4.856
## 6 -0.5 0.625
## 7 -0.4 3.856
## 8 -0.3 5.323
## 9 -0.2 5.512
## 10 -0.1 4.909
## 11 0.0 4.000
Membuat Vektor
# Membuat Vektor
x <- c(-10:10); y <- 81*(x^3) + 9*(x^2) - 9*x + 4
Membuat Grafik
plot(x, y, type="o")
Penyelesaian Secara Manual
# Titik potong dengan sumbu x (y = 0)
x^4 - 4x^2 - 5 = 0
(x^2 - 5)(x^2 + 1) = 0
x^2 = 5 atau x^2 = -1
x = ±√5
Jadi, titik potong dengan sumbu x: (√5,0), (-√5,0)
# Titik potong dengan sumbu y (x = 0):
Masukkan nilai x = 0 ke persamaan polinomial
y = (0)^4 – 4(0)^2 -5 = 0
y = -5
Jadi, titik potong dengan sumbu y: (0,-5)
# Titik ekstrim (y’ = 0):
y’ = 0
4x^3 – 8x = 0
4x^2(x^2 – 2) = 0
4x = 0 atau x^2 = 2
x = 0 atau x^2 = ±√2
x = ±0 (batas rangkap) atau 4x = 3 → x = ¾
x = 0 → y = -5
x = √2 → y = -9
x = -√2 → y = -9
Jadi, titik ekstrimnya: (0,-5), (–√2, –9), (√2, –9)
Dari hasil penrhitungan manual di atas didapatkan hasil bahwa titik potong pada sumbu x adalah (√5,0), (-√5,0), titik potong pada sumbu y adalah (0,-5), dan titik ekstrimnya adalah (0,-5), (–√2, –9), (√2, –9)
Fungsi polyroot y = x^4 - 4x^2 - 5
polyroot(c(1,0,-4,0,-5))
## [1] 0.4472136+0i -0.4472136+0i 0.0000000-1i 0.0000000+1i
Rumus tabel
# Rumus Membuat Tabel
root_table <- function(f, a, b, N=10){
h <- abs((a+b)/N)
x <- seq(from=a, to=b, by=h)
fx <- rep(0, N+1)
for(i in 1:(N+1)){
fx[i] <- f(x[i])
}
data <- data.frame(x=x, fx=fx)
return(data)
}
Membuat Tabel
# Membuat Tabel
tabel <- root_table(f=function(x){x^4 - 4*(x^2) - 5},
a=0, b=5, N=10)
print(tabel)
## x fx
## 1 0.0 -5.0000
## 2 0.5 -5.9375
## 3 1.0 -8.0000
## 4 1.5 -8.9375
## 5 2.0 -5.0000
## 6 2.5 9.0625
## 7 3.0 40.0000
## 8 3.5 96.0625
## 9 4.0 187.0000
## 10 4.5 324.0625
## 11 5.0 520.0000
Membuat Vektor
# Membuat Vektor
x <- c(-3:3); y <- x^4 - 4*(x^2) - 5
Membuat Grafik
plot(x, y, type="o")
Fungsi polyroot y = x^4 - 2x^3 + 3x - 6
polyroot(c(1,-2,3,-6))
## [1] 0.5+0.0000000i 0.0+0.5773503i 0.0-0.5773503i
Rumus tabel
# Rumus Membuat Tabel
root_table <- function(f, a, b, N=10){
h <- abs((a+b)/N)
x <- seq(from=a, to=b, by=h)
fx <- rep(0, N+1)
for(i in 1:(N+1)){
fx[i] <- f(x[i])
}
data <- data.frame(x=x, fx=fx)
return(data)
}
Membuat Tabel
# Membuat Tabel
tabel <- root_table(f=function(x){x^4 - 2*(x^3) + 3*x - 6},
a=0, b=5, N=10)
print(tabel)
## x fx
## 1 0.0 -6.0000
## 2 0.5 -4.6875
## 3 1.0 -4.0000
## 4 1.5 -3.1875
## 5 2.0 0.0000
## 6 2.5 9.3125
## 7 3.0 30.0000
## 8 3.5 68.8125
## 9 4.0 134.0000
## 10 4.5 235.3125
## 11 5.0 384.0000
Membuat Vektor
# Membuat Vektor
x <- c(-3:3); y <- x^4 - 2*(x^3) + 3*x - 6
Membuat Grafik
plot(x, y, type="o")
Fungsi polyroot y = 2x^3 + 5x^2 - 8
polyroot(c(2,5,0,-8))
## [1] -0.4716989+0.2061544i -0.4716989-0.2061544i 0.9433979+0.0000000i
Rumus tabel
# Rumus Membuat Tabel
root_table <- function(f, a, b, N=10){
h <- abs((a+b)/N)
x <- seq(from=a, to=b, by=h)
fx <- rep(0, N+1)
for(i in 1:(N+1)){
fx[i] <- f(x[i])
}
data <- data.frame(x=x, fx=fx)
return(data)
}
Membuat Tabel
# Membuat Tabel
tabel <- root_table(f=function(x){2*(x^3) + 5*(x^2) - 8},
a=0, b=5, N=10)
print(tabel)
## x fx
## 1 0.0 -8.0
## 2 0.5 -6.5
## 3 1.0 -1.0
## 4 1.5 10.0
## 5 2.0 28.0
## 6 2.5 54.5
## 7 3.0 91.0
## 8 3.5 139.0
## 9 4.0 200.0
## 10 4.5 275.5
## 11 5.0 367.0
Membuat Vektor
# Membuat Vektor
x <- c(-3:3); y <- 2*(x^3) + 5*(x^2) - 8
Membuat Grafik
plot(x, y, type="o")
Demikian, solusi penyelesaian persamaan polinomial dengan Fungsi polyroot pada R Markdown di aplikasi R Studio. Maaf apabila terdapat rumus-rumus atau cara yang salah karena disini saya juga masih belajar. Semoga bermanfaat.