A car’s position is \(\vec{r}(t) = \langle t^3,4t \rangle\) meters. What is its velocity vector at \(t = 2\)?
# install.packages("Deriv")
library(Deriv)
r <- function(t) {
c(t^3,4 * t)
}
v <- Deriv(r) # velocity vector
answer <- v(t = 2)
cat("The velocity vector at t = 2 is:",answer,"\n")
## The velocity vector at t = 2 is: 12 4
Write 751 in words.
# install.packages("english")
library(english)
## Warning: package 'english' was built under R version 4.5.2
words(751)
## [1] "seven hundred fifty-one"
\(225^{\circ}\) is the same as _____ radians.
# install.packages("pracma")
library(pracma)
value <- deg2rad(deg = 225)
cat("225 degrees =",value,"radians","\n")
## 225 degrees = 3.926991 radians
Find the coordinates of the point or points of intersection of the straight line \(f(x) = x - 4\) and the curve \(g(x) = \sqrt{2x - 5}\).
# install.packages("tidyverse")
library(tidyverse)
## Warning: package 'lubridate' was built under R version 4.5.2
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.1 ✔ stringr 1.5.2
## ✔ ggplot2 4.0.0 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.1.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ purrr::cross() masks pracma::cross()
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
f <- function(x) {
x - 4
}
g <- function(x) {
sqrt(2 * x - 5)
}
x_values <- seq(5,10,length.out = 500)
f_values <- f(x_values)
g_values <- g(x_values)
q4_data <- data.frame(x = x_values,f = f_values,g = g_values)
result <- uniroot(function(x) f(x) - g(x),interval = c(5,10))$root
ggplot(q4_data,aes(x = x)) +
geom_line(aes(y = f),col = "blue",lwd = 1.25) + # f(x)
geom_line(aes(y = g),col = "red",lwd = 1.25) + # g(x)
labs(title = "Graphs of f(x) and g(x)",
caption = paste("The intersection is at: (",round(result,2),",",round(f(result),2),")"),
x = "x",
y = "y") +
theme_gray(base_size = 14)
What is \(\int 5 \sin^4(x) \cos(x) dx\)?
# install.packages(c("ggformula","mosaicCalc"))
library(ggformula)
## Warning: package 'ggformula' was built under R version 4.5.2
## Loading required package: scales
##
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
##
## discard
## The following object is masked from 'package:readr':
##
## col_factor
## The following object is masked from 'package:english':
##
## ordinal
## Loading required package: ggiraph
## Warning: package 'ggiraph' was built under R version 4.5.2
## Loading required package: ggridges
## Warning: package 'ggridges' was built under R version 4.5.2
##
## New to ggformula? Try the tutorials:
## learnr::run_tutorial("introduction", package = "ggformula")
## learnr::run_tutorial("refining", package = "ggformula")
library(mosaicCalc)
## Warning: package 'mosaicCalc' was built under R version 4.5.2
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
h <- makeFun(5 * (sin(x))^4 * cos(x) ~ x)
anti_h <- antiD(h(x) ~ x)
anti_h
## function (x, C = 0)
## (10 * sin(x) + 5 * sin(-3 * x) - sin(-5 * x))/16 + C