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}} \]
rate_ladder <- function(x){
dx <- 1
dy <- -(x/sqrt(24^2-x^2))*dx
return(dy)
}
x <-1
rate_ladder(x)
## [1] -0.04170288
x <- 10
rate_ladder(x)
## [1] -0.4583492
x <- 23
rate_ladder(x)
## [1] -3.354895
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.