Nama : Muhammad Hafidlul Qolbi
NIM : 220605110063
Kelas : C
Mata Kuliah : Kalkulus
Dosen Pengampuh : Prof. Dr. Suhartono, M.Kom
Jurusan : Teknik Informatika
Lembaga : Universitas Islam Negeri Maulana Malik Ibrahim Malang
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
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
g <- D(x^2 ~ x)
g(1)
## [1] 2
library(mosaicCalc)
my_function <- function(x)(
return(5 * x^5)
)
my_function(2)
## [1] 160
g <- D(5*x^5 ~ x)
g
## function (x)
## 25 * x^4
g <- D(my_function(x) ~ x)
g(2)
## [1] 400
library(mosaicCalc)
s2 <- D(A * sin(2 * pi * t / P) + C ~ t)
s2( t=3, A=2, P=10, C=4 )
## [1] -0.3883222
slice_plot(s2(t, A=2, P=10, C=4) ~ t,
domain(t=range(0,20)))
Latihan nomer 1
library(mosaicCalc)
g <- D(3 * x ^ 2 - 2*x + 4 ~ x)
g(-6)
## [1] -38
g(-4)
## [1] -26
g(-3)
## [1] -20
g(-2)
## [1] -14
g (0)
## [1] -2
g(2)
## [1] 10
g(3)
## [1] 16
g(4)
## [1] 22
g(6)
## [1] 34
slice_plot(3 * x ^ 2 - 2*x + 4 ~ x, domain (x = range(40,-40)))
Latihan 2
library(mosaicCalc)
g <- D(5 * exp(0.2 * x) ~ x)
g(-5)
## [1] 0.3678794
g(-2)
## [1] 0.67032
g(-1)
## [1] 0.8187308
g(0)
## [1] 1
g(1)
## [1] 1.221403
g(2)
## [1] 1.491825
g(5)
## [1] 2.718282
slice_plot(5 * exp(0.2 * x) ~ x, domain (x = range(0,3)))