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
## Loading required package: Deriv
## Loading required package: Ryacas
##
## Attaching package: 'Ryacas'
## The following objects are masked from 'package:Matrix':
##
## diag, diag<-
## The following object is masked from 'package:stats':
##
## integrate
## The following objects are masked from 'package:base':
##
## %*%, diag, diag<-, lower.tri, upper.tri
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
g <- makeFun(sin(x^2)*cos(sqrt(x^4 + 3 )-x^2) - x + 1 ~ x)
slice_plot(g(x) ~ x, domain(x = -3:7)) %>%
gf_hline(yintercept = 0, color = "red")
4.1.2 Beberapa Solusi
findZeros(g(x) ~ x, xlim = range(-1000, 1000))
## x
## 1 1.5576
findZeros(g(x) ~ x, xlim = range(1, 2))
## x
## 1 1.5576
findZeros( sin(x) - 0.35 ~ x, xlim=range(-20,15) )
## x
## 1 -16.0655
## 2 -12.2088
## 3 -9.7824
## 4 -5.9256
## 5 -3.4992
## 6 0.3576
## 7 2.7840
## 8 6.6408
## 9 9.0672
## 10 12.9239