Solve the system of equations below.
\[2x + 5y = 19 \\ 3x - 2y = 4\]
q1_data <- data.frame(x = c(2,3),
y = c(5,-2),
constants = c(19,4))
q1_model <- lm(constants ~ . - 1,data = q1_data)
coef(q1_model)
## x y
## 3.052632 2.578947
If \(f(x) = (x + 2)(x - 5)\), what is \(f'(x)\)?
# install.packages("Deriv")
library(Deriv)
f <- function(x) {
(x + 2) * (x - 5)
}
f_prime <- Deriv(f)
f_prime
## function (x)
## 2 * x - 3
Find the positive solution to \(3x^6 - 6x^4 - 1 = 0\).
# install.packages("rootSolve")
library(rootSolve)
g <- function(x) {
3 * x^6 - 6 * x^4 - 1
}
roots <- uniroot.all(g,interval = c(0,5))
for (x in seq_along(roots)) {
cat("Root",x,":",roots[x],"\n")
}
## Root 1 : 1.441238
Write 4,082,389 in words.
# install.packages("english")
library(english)
## Warning: package 'english' was built under R version 4.5.2
words(4082389)
## [1] "four million eighty-two thousand three hundred eighty-nine"