Question 1

Let \(f(x,y) = x \cos(y) + ye^{xy}\). What is the value of the third-order partial derivative \(f_{yxy}(0,\pi)\)?

# install.packages("Deriv")
library(Deriv)
f <- function(x,y) {
  x * cos(y) + y * exp(x * y)
}
f_y <- Deriv(f,"y")
f_yx <- Deriv(f_y,"x")
f_yxy <- Deriv(f_yx,"y")
answer <- f_yxy(x = 0,y = pi)
cat("f_yxy (0,pi) =",answer,"\n")
## f_yxy (0,pi) = 3

Question 2

Convert \(250^{\circ}\) to radians.

# install.packages("pracma")
library(pracma)
value <- deg2rad(deg = 250)
cat("250 degrees =",value,"radians","\n")
## 250 degrees = 4.363323 radians

Question 3

Evaluate and graph the following definite integral.

\[\int_{1}^{e} \frac{1}{x} \space dx\]

# 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
g <- function(x) {
  1 / x
}
result <- integrate(f = g,lower = 1,upper = exp(1))$value # exp(1) = e
x_values <- seq(1,exp(1),length.out = 500)
y_values <- g(x_values)
q3_data <- data.frame(x = x_values,y = y_values)
ggplot(q3_data,aes(x = x,y = y)) +
  geom_line(col = "black",lwd = 2) +
  geom_ribbon(aes(ymin = 0,ymax = y),fill = "steelblue") +
  labs(title = "Graph of g(x) = 1 / x",
       caption = paste("Answer:",result),
       x = "x",
       y = "y") +
  theme_gray()