Question 1

Given \(B(x) = \sqrt{x} + \frac{1}{2}x\) is an antiderivative of \(b(x)\), find \(\int_{4}^{9} b(x) \space dx\).

# install.packages("Deriv")
library(Deriv)
B <- function(x) {
  sqrt(x) + 0.5 * x
}
b <- Deriv(B)
answer <- integrate(f = b,lower = 4,upper = 9)$value
cat("The answer is:",answer,"\n")
## The answer is: 3.5

Question 2

Put \([3768,3786,8736,7836,7638]\) in descending order.

# 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() ──
## ✖ 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
q2_data <- data.frame(Value = c(3768,3786,8736,7836,7638))
q2_data %>%
  arrange(desc(Value)) # arrange(): ascending order, desc(): descending order
##   Value
## 1  8736
## 2  7836
## 3  7638
## 4  3786
## 5  3768

Question 3

Plot the corresponding polygon with the given data below.

# install.packages("tidyverse")
library(tidyverse)
q3_data <- data.frame(X = c(-4,3,3,1,1,-4),
                      Y = c(3,3,-2,-2,-5,-5))
ggplot(q3_data,aes(x = X,y = Y)) +
  geom_polygon(fill = "pink",col = "black",lwd = 1.25) +
  geom_point(size = 3) +
  coord_equal() +
  theme_gray()

Question 4

Find the cube root of 172 correct to 2 decimal places.

# install.packages("pracma")
library(pracma)
## 
## Attaching package: 'pracma'
## The following object is masked from 'package:purrr':
## 
##     cross
result <- nthroot(x = 172,n = 3) # x = 172 (our value),n = 3 (cube root)
cat("The cube root of 172 correct to 2 decimal places is:",round(result,2),"\n")
## The cube root of 172 correct to 2 decimal places is: 5.56

Question 5

What is \(\int \sqrt[3]{x} \space dx\)?

# install.packages(c("ggformula","mosaicCalc","pracma"))
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
## 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
library(pracma)
f <- makeFun(nthroot(x,3) ~ x)
anti_f <- antiD(f(x) ~ x)
anti_f
## function (x, C = 0) 
## {
##     F <- makeF(nthroot(x, 3))
##     evalFun(F, x = x, .const = C)
## }
## <environment: 0x000002350f3c0f20>