# R code to compute the arc length of y = x^2 from x = 0 to x = 1
library(pracma)
f <- function(x) { sqrt(1 + (2*x)^2) }
arc_length <- integral(f, 0, 1)
arc_length[1] 1.478943
The arc length of a curve defined by a function [ y = f(x) ] from [ x = a ] to [ x = b ] can be calculated using the following formula:
\[ L = \int_{a}^{b} \sqrt{1 + \left( \frac{dy}{dx} \right)^2} \, dx \]
where \(\frac{dy}{dx}\) is the derivative of the function \(f(x)\). To compute the arc length, follow these steps:
Consider the function \(f(x) = x^2\) from \(x = 0\) to \(x = 1\):
# R code to compute the arc length of y = x^2 from x = 0 to x = 1
library(pracma)
f <- function(x) { sqrt(1 + (2*x)^2) }
arc_length <- integral(f, 0, 1)
arc_length[1] 1.478943
You can use trigonometric substitution to evaluate the integral:
Let \(x = \frac{1}{2} \tan(\theta)\), then \(dx = \frac{1}{2} \sec^2(\theta) d\theta\).
Substitute into the integral:
\[L = \int \sqrt{1 + 4\left(\frac{1}{2} \tan(\theta)\right)^2} \cdot \frac{1}{2} \sec^2(\theta) d\theta\]
\[ L = \frac{1}{2} \int \sec(\theta) \sec^2(\theta) d\theta = \frac{1}{2} \int \sec^3(\theta) d\theta\]
The integral of \(\sec^3(\theta)\) can be computed using integration by parts as folows: \[\int \sec^3(\theta) d\theta = \int \sec(\theta)(\sec^2(\theta)) d\theta\]
Let \(u = \sec(\theta)\) and \(dv = \sec^2(\theta) d\theta\), then \(du = \sec(\theta) \tan(\theta) d\theta\) and \(v = \tan(\theta)\).
Applying integration by parts: \[\int \sec^3(\theta) d\theta = \sec(\theta) \tan(\theta) - \int \sec(\theta) \tan^2(\theta) d\theta\] Using the identity \(\tan^2(\theta) = \sec^2(\theta) - 1\), we have: \[\int \sec^3(\theta) d\theta = \sec(\theta) \tan(\theta) - \int \sec^3(\theta) d\theta + \int \sec(\theta) d\theta.\] Rearranging gives: \[2 \int \sec^3(\theta) d\theta = \sec(\theta) \tan(\theta) + \int \sec(\theta) d\theta.\] The integral of \(\sec(\theta)\) is: \[\int \sec(\theta) d\theta = \ln|\sec(\theta) + \tan(\theta)| + .C\]
\[L = \frac{1}{2} \left[ \frac{1}{2} \sec(\theta) \tan(\theta) + \frac{1}{2} \ln|\sec(\theta) + \tan(\theta)| \right] + C\].
Note, the first comes from the substitution for dx.
To express the result back in terms of \(x\), we
\(\sec(\theta) = \sqrt{1 + 4x^2}\)
. (this comes from the original substitution and thinking about the right triangle where the hypotenuse is \(\sqrt{1 + 4x^2}\) and the adjacent side is 1
\(\tan(\theta) = 2x\).
\[L = \frac{1}{4} \left[ \sqrt{1 + 4x^2} \cdot 2x + \ln\left|\sqrt{1 + 4x^2} + 2x\right| \right]_{0}^{1}\]
Evaluating this expression at the limits will give you the arc length of the curve from \(x = 0\) to \(x = 1\).
# R code to compute the arc length of y = x^2 from x = 0 to x = 1 using the trigonometric substitution result
L = (1/4) * ((sqrt(1 + 4*1^2) * 2*1 + log(abs(sqrt(1 + 4*1^2) + 2*1))) -
(sqrt(1 + 4*0^2) * 2*0 + log(abs(sqrt(1 + 4*0^2) + 2*0))))
L[1] 1.478943
Find the arc length of the curve \[ y^2 = x^3\] from (1,1) to (4,8).
Express y in terms of x: From the equation \(y^2 = x^3\), we have \(y = x^{3/2}\).
Find the Derivative: \(\frac{dy}{dx} = \frac{3}{2} x^{1/2}\)
Set Up the Integral: \[ L = \int_{1}^{4} \sqrt{1 + \left( \frac{3}{2} x^{1/2} \right)^2} \, dx = \int_{1}^{4} \sqrt{1 + \frac{9}{4} x} \, dx \]
Evaluate the Integral: This integral can be computed using u-substitution) to find the arc length.
The result will give you the length of the curve \(y^2 = x^3\) from \((1,1)\) to \((4,8)\).
Let \(u = 1 + \frac{9}{4} x\), then \(du = \frac{9}{4} dx\) or \(dx = \frac{4}{9} du\).
Change the limits of integration:
Substitute into the integral: \[ L = \int_{\frac{13}{4}}^{10} \sqrt{u} \cdot \frac{4}{9} du = \frac{4}{9} \int_{\frac{13}{4}}^{10} u^{1/2} du \]
Evaluate the integral: \[ L = \frac{4}{9} \left[ \frac{2}{3} u^{3/2} \right]_{\frac{13}{4}}^{10} = \frac{8}{27} \left[ 10^{3/2} - \left(\frac{13}{4}\right)^{3/2} \right] \]
# R code to compute the arc length of y^2 = x^3 from (1,1) to (4,8)
L2 = (8/27) * (10^(3/2) - (13/4)^(3/2))
L2[1] 7.633705