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

Ada lebih dari satu cara untuk membatalkan turunan. Lihat lah fungsi-fungsi berikut, yang masing-masing berbeda:

f1 <- makeFun(sin(x ^ 2) ~ x)
f2 <- makeFun(sin(x ^ 2)  +  3 ~ x)
f3 <- makeFun(sin(x ^ 2)  -  100 ~ x)
f1(1)
## [1] 0.841471
f2(1)
## [1] 3.841471
f3(1)
## [1] -99.15853

Terlepas dari kenyataan bahwa fungsi f1(x),f2(x),dan f3(x) berbeda semuanya memiliki turunan yang sama

df1 = D(f1(x) ~ x)
df2 = D(f2(x) ~ x)
df3 = D(f3(x) ~ x)
df1(1)
## [1] 1.080605
df2(1)
## [1] 1.080605
df3(1)
## [1] 1.080605