library(Deriv)
f<-function(x){1-exp(-lx)}
Deriv(f)
## function (x)
## 0
library(Deriv)
f<-function(x){(x-a)/(b-a)}
Deriv(f)
## function (x)
## 1/(b - a)
library(Deriv)
f<-function(x){(x-a)^2 / (b-a)(c-a)}
Deriv(f)
## function (x)
## 2 * ((x - a)/(b - a)(c - a))
library(Deriv)
f<-function(x){1-((b-x)^2 / (b-a)(c-a))}
Deriv(f)
## function (x)
## 2 * ((b - x)/(b - a)(c - a))
f<-function(x){3*x^3}
integrate(f,0,10)
## 7500 with absolute error < 8.3e-11
library(mosaicCalc)
## Loading required package: mosaicCore
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
f<-function(x)x*antiD(exp(-x)~x)-(1-exp(-x))
antiD(f~x)
## function (x, C = 0, f)
## f * x + C
a<-0
b<-.5
f<-function(x){1/(b-a)}
integrate(Vectorize(f),a,b)
## 1 with absolute error < 1.1e-14
unknown
A<-matrix(c(1,3,4,2,3,6,3,1,8),ncol=3)
solve(A)
## [,1] [,2] [,3]
## [1,] -4.5 -0.5 1.75
## [2,] 5.0 1.0 -2.00
## [3,] -1.5 -0.5 0.75
A<-matrix(c(1,3,4,2,3,6,3,1,8),ncol=3)
determinant(A)
## $modulus
## [1] 1.386294
## attr(,"logarithm")
## [1] TRUE
##
## $sign
## [1] -1
##
## attr(,"class")
## [1] "det"
library(Matrix)
A<-matrix(c(1,3,4,2,3,6,3,1,8),ncol=3)
lu(A)
## 'MatrixFactorization' of Formal class 'denseLU' [package "Matrix"] with 4 slots
## ..@ x : num [1:9] 4 0.75 0.25 6 -1.5 ...
## ..@ perm : int [1:3] 3 2 3
## ..@ Dimnames:List of 2
## .. ..$ : NULL
## .. ..$ : NULL
## ..@ Dim : int [1:2] 3 3
expand(lu(A))
## $L
## 3 x 3 Matrix of class "dtrMatrix" (unitriangular)
## [,1] [,2] [,3]
## [1,] 1.0000000 . .
## [2,] 0.7500000 1.0000000 .
## [3,] 0.2500000 -0.3333333 1.0000000
##
## $U
## 3 x 3 Matrix of class "dtrMatrix"
## [,1] [,2] [,3]
## [1,] 4.0000000 6.0000000 8.0000000
## [2,] . -1.5000000 -5.0000000
## [3,] . . -0.6666667
##
## $P
## 3 x 3 sparse Matrix of class "pMatrix"
##
## [1,] . . |
## [2,] . | .
## [3,] | . .
A<-matrix(c(1,3,4,2,3,6,3,1,8),ncol=3)
A%*%solve(A)
## [,1] [,2] [,3]
## [1,] 1.000000e+00 -2.220446e-16 4.440892e-16
## [2,] -4.440892e-16 1.000000e+00 2.220446e-16
## [3,] 0.000000e+00 0.000000e+00 1.000000e+00