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

Lembaga : Universitas Islam Negri Maulana Malik Ibrahim Malang

Jurusan : Teknik Informatika

Fakultas : Sains dan Teknologi

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
  1. latihan 1

menentukan nilai numerik dari integral berikut ini: 1.∫52x1.5dx Jawab:

menentukan nilai numerik dari integral di r studio yang pertama yakni dengan menghitung anti turunan pada fungsi dengan fungsi antiD(). selanjutnya membuat integral . disini kita menggunakan variabel x. lalu masukkan argumen “to” dan “from” dalam x dengan format (x=to) dan (x=from). seperti di bawah ini:

fun=antiD(x^1.5~x)
fun(x=2)-fun(x=5)
## [1] -20.09794

2.∫10-0sin(x2)dx

fun=antiD(sin(x^2)~x)
fun(x=0)-fun(x=10)
## [1] -0.5836709

3.∫41e2xdx

fun= antiD(exp(2*x)~x)
fun(x=4)-fun(x=1)
## [1] 1486.784

jadi jawabannya 1486.784.

4.∫2−2e2xdx

fun= antiD(exp(2*x)~x)
fun(x=2)-(x=-2)
## [1] 29.29908

5.∫2−2e2|x|dx

f= antiD(exp(2*x)~x)
f(x=-2)-(x=2)
## [1] -1.990842

2.latihan 2

adakah hubungan antara ∫baf(x)dx and ∫abf(x)dx integral dengan fungsi yang sama.

fun= antiD(x^2~x)
fun(x=2)-(x=2)
## [1] 0.6666667
fun=antiD(x^2~x)
fun(x=-2)-(x=2)
## [1] -4.666667
fun= antiD(x^2~x)
fun(x=4)-(x=2)
## [1] 19.33333
fun=antiD(x^2~x)
fun(x=2)-(x=4)
## [1] -1.333333

setelah melakukan percobaan dapat terlihat jika integral nya di tukar antara variabel a dan b maka hasil yang di dapat adalah yang satu negatif dari yg lain.

3.latihan 3

gaussian <- 
  makeFun((1/sqrt(2*pi*sigma^2)) * 
            exp( -(x-mean)^2/(2*sigma^2)) ~ x,
          mean=2, sigma=2.5)
slice_plot(gaussian(x) ~ x, domain(x = -5:10)) %>%
  slice_plot(gaussian(x, mean=0, sigma=1) ~ x, color="red")

erf <- antiD(gaussian(x, mean=m, sigma=s) ~ x)
erf
## function (x, C = 0, m, s) 
## {
##     F <- makeF(gaussian(x, mean = m, sigma = s))
##     evalFun(F, x = x, m = m, s = s, .const = C)
## }
## <environment: 0x0000022735ba0a18>
erf(x = 1, m=0, s=1) - erf(x = 0, m=0, s=1)
## [1] 0.3413447
erf(x = 0, m=0, s=2) - erf(x = 2, m=0, s=2)
## [1] -0.3413447
erf(x = -Inf, m=3, s=10) - erf(x = 3, m=3, s=10)
## [1] -0.5
erf(x = Inf, m=3, s=10) - erf(x = -Inf, m=3, s=10)
## [1] 1

erf adalah nama fungsi Error sama seperti sin nama fungsi sinus.