Excersise 4.2 #9

A 24ft. ladder is leaning against a house while the base is pulled away at a constant rate of ft/s.

At what rate is the top of the ladder sliding down the side of the house when the base is:

First the equation needs to be derived with respect to time:

\[ x^2 + y^2 = 24^2\\ 2x \frac{dx}{dt} + 2y \frac{dy}{dt} = 0\]

\[-\frac{x}{y}\frac{dx}{dt}\\ - \frac{x}{\sqrt{24^2-x^2}} \]

Function for calculation the derived expression from above:

rate_ladder <- function(x){
  dx <- 1
  dy <- -(x/sqrt(24^2-x^2))*dx
  return(dy)
}

a. 1 foot from the house

x <-1
rate_ladder(x)
## [1] -0.04170288

b. 10 feet from the house

x <- 10
rate_ladder(x)
## [1] -0.4583492

c. 23 feet from the house

x <- 23
rate_ladder(x)
## [1] -3.354895

d. 24 feet from the house

x <- 24
rate_ladder(x)
## [1] -Inf

This -inf value makes sense, because this is only a 24 foot ladder, 24 feet away from the house would mean this it is now flat on the ground, not moving.