Dosen Pengampu : Prof. Dr.Suhartono, M.Kom

Lembaga : Universitas Islam Negeri Maulana Malik Ibrahim Malang

Fakultas : Sains dan Teknologi

Jurusan : Teknik Informatika

Kelas : (C) Kalkulus

NIM : 230605110080

library(mosaicCalc)
## Loading required package: mosaic
## Registered S3 method overwritten by 'mosaic':
##   method                           from   
##   fortify.SpatialPolygonsDataFrame ggplot2
## 
## The 'mosaic' package masks several functions from core packages in order to add 
## additional features.  The original behavior of these functions should not be affected by this.
## 
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
## 
##     count, do, tally
## The following object is masked from 'package:Matrix':
## 
##     mean
## The following object is masked from 'package:ggplot2':
## 
##     stat
## The following objects are masked from 'package:stats':
## 
##     binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
##     quantile, sd, t.test, var
## The following objects are masked from 'package:base':
## 
##     max, mean, min, prod, range, sample, sum
## Loading required package: mosaicCore
## 
## Attaching package: 'mosaicCore'
## The following objects are masked from 'package:dplyr':
## 
##     count, tally
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, will retire in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## The sp package is now running under evolution status 2
##      (status 2 uses the sf package in place of rgdal)
## 
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
## 
##     D
library(ggplot2)

DIFERENSIASI

“Deferensiasi” adalah istilah dalam bahasa Indonesia yang setara dengan “differentiation” dalam bahasa Inggris. Dalam konteks kalkulus, “diferensiasi” merujuk pada proses menghitung turunan suatu fungsi terhadap variabelnya. Turunan mengukur perubahan suatu fungsi terhadap variabel independennya.

Terdapat beberapa konsep dasar dalam diferensiasi kalkulus salah satunya penggunaan diferensiasi titik stasioner dan nilai ekstrem: Turunan nol dari suatu fungsi memberikan titik-titik di mana fungsi tersebut mencapai nilai ekstrem (maksimum atau minimum).

CONTOH:

FUNGSI PENDAPATAN TOTAL

Misalkan memiliki fungsi pendapatan total suatu perusahaan P(x) yang menggambarkan pendapatan yang diperoleh dari penjualan x unit produk. Fungsi ini dapat diwakili oleh persamaan:

P(x)= −2x^3 + 100x^2 − 1000x

  1. Langkah pertama adalah menghitung turunan pertama dari fungsi ini, P′(x), untuk menemukan titik-titik stasioner di mana P′(x)= 0

    P′(x)= −6x^2 + 200x − 1000

  2. Sekarang, atur P′(x) sama dengan nol untuk menemukan titik-titik stasioner:

    −6x^2 + 200x − 1000 = 0

  3. Setelah menyelesaikan persamaan kuadrat ini, dapat menemukan nilai-nilai x yang memberikan P′(x)=0.

  4. Setelah menemukan titik-titik stasioner, kita dapat menggunakan turunan kedua untuk menentukan apakah titik-titik tersebut merupakan nilai minimum atau maksimum. Turunan kedua dari P(x) adalah:

    P′′(x)= −12x + 200

  5. Jika P′′(x)>0, titik stasioner tersebut adalah nilai minimum, dan jika P′′(x)<0, titik stasioner tersebut adalah nilai maksimum.

Dengan informasi ini, dapat dianalisis bagaimana perusahaan dapat mengoptimalkan pendapatan totalnya dengan memilih jumlah produk yang optimal untuk dijual.

library(rootSolve)
# Install paket rootSolve jika belum diinstal
# install.packages("rootSolve")

# Load paket rootSolve
library(rootSolve)

# Definisikan Fungsi Pendapatan Total
P <- function(x) {
  return(-2*x^3 + 100*x^2 - 1000*x)
}

# Hitung Turunan Pertama
P_prime <- function(x) {
  return(-6*x^2 + 200*x - 1000)
}

# Cari Titik-titik Stasioner
stasioner <- uniroot(P_prime, interval = c(0, 20))
x_stasioner <- stasioner$root
y_stasioner <- P(x_stasioner)

# Hitung Turunan Kedua
P_double_prime <- function(x) {
  return(-12*x + 200)
}

# Analisis Titik-titik Stasioner
if (P_double_prime(x_stasioner) > 0) {
  cat("Titik stasioner pada x =", x_stasioner, "adalah nilai minimum.\n")
} else if (P_double_prime(x_stasioner) < 0) {
  cat("Titik stasioner pada x =", x_stasioner, "adalah nilai maksimum.\n")
} else {
  cat("Tidak dapat memastikan jenis nilai pada titik stasioner.\n")
}
## Titik stasioner pada x = 6.125741 adalah nilai minimum.