Nama : Ahmad Fadhli Dzilikrom Nim : 220605110078
Chapter 7 Derivatif & diferensiasi
library(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
library(mosaicCalc)
## 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
g(3.5)
## [1] 7
7.1 rumus dan selisih numerik
g
## function (x)
## 2 * x
## <bytecode: 0x000001949c537388>
h <- D(sin(abs(x - 3) ) ~ x)
h
## function (x)
## {
## .e1 <- x - 3
## cos(abs(.e1)) * sign(.e1)
## }
7.2 Parameter Simbolis
s2 <- D(A * sin(2 * pi * t / P) + C ~ t)
s2
## function (t, A, C, P)
## (2 * A * pi * cos((2 * pi * t)/P))/P
s2
## function (t, A, C, P)
## (2 * A * pi * cos((2 * pi * t)/P))/P
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)))
7.3 Derivatif Parsial
7.3.1 Turunan kedua
df <- D(sin(x) ~ x)
ddf <- D(df(x) ~ x)
another.ddf <- D(sin(x) ~ x & x)
7.3.2 Latihan
7.3.2.1 Latihan 1 7.3.2.2 Latihan 2 7.3.2.3 Latihan 3 7.3.2.4 Latihan 4
D(fred^2 ~ ginger)
## function (fred, ginger)
## 0
7.3.2.5 Latihan 5 7.3.2.6 Latihan 6 7.3.2.7 Latihan 7
pxy = D(x * sin(y) ~ x & y)
pyx = D(x * sin(y) ~ y & x)