Matkul : Kalkulus, Dosen Pengampu : Prof. Dr. SUHARTONO, M.Kom
Integral adalah suatu fungsi yang digunakan untuk mengembalikan fungsi asli dari fungsi yang telah dibuat sebelumnya
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
f <- makeFun( A * x ^ 2 ~ x, A = 0.5)
f(1)
## [1] 0.5
f(2)
## [1] 2
f(3)
## [1] 4.5
df <- D(f(x) ~ x)
df(1)
## [1] 1
df(2)
## [1] 2
df(3)
## [1] 3
slice_plot(f(x) ~ x, domain(x = -1:1), color = "blue") %>%
gf_labs(title = "Original function f(x)")
slice_plot(df(x) ~ x, domain(x =-1:1), color = "purple") %>%
gf_labs(title = "New function df(x), the derivative of f(x)")
slice_plot(df(x) ~ x, domain(x=-1:1), color = "red") %>%
gf_labs(title = "Original function df(x)")
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
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
fun = antiD( x^2 ~ x )
fun
## function (x, C = 0)
## x^3/3 + C
fun(x = 2) - fun(x = -1)
## [1] 3
Daftar Pustaka : https://dtkaplan.github.io/RforCalculus/