数学のブログ

ベクトルの微分 曲線の長さ、累乗、指数関数、置換積分法、双曲線関数(sinh、cosh)、逆関数、速度ベクトル、積分

続 解析入門 (原書第2版) (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第2章(ベクトルの微分)、2(曲線の長さ)の練習問題3の解答を求めてみる。

  1. d dt ( t , 2 t , t 2 ) = ( 1 , 2 , 2 t )
    1 + 4 + 4 t 2 dt = 5 + 4 t 2 dt
    t = 5 2 u
    1 = 5 2 d u dt
    5 + 4 · 5 4 u 2 5 2 d u = 5 2 1 + u 2 d u
    u = e s - e - s 2 = sinh s
    d u d s = e s + e - s 2
    1 + u 2 = 1 + sinh 2 s = cosh 2 s = ( e s + e - s 2 ) 2
    5 2 1 + u 2 d u
    = 5 2 e s + e - s 2 · e s + e - s 2 d s
    = 5 2 3 ( e 2 s + e - 2 s + 2 ) d s
    = 5 2 3 ( 1 2 e 2 s - 1 2 e - 2 s + 2 s )
    t = 1 , 3 u = 2 5 , 6 5
    s = sinh - 1 u s = sinh - 1 2 5 , sinh - 1 6 5 s = log 5 , log ( 6 5 + 41 5 ) s = log 5 , log 6 + 41 5

    よって、 求める曲線の長さは

    5 2 3 ( 1 2 ( ( 6 + 41 5 ) 2 - ( 5 ) 2 ) - 1 2 ( ( 6 + 41 5 ) - 2 - ( 5 ) - 2 ) + 2 ( log 6 + 41 5 - log 5 ) )
    = 5 2 4 ( 77 + 12 41 5 - 5 ) - 5 2 4 ( 5 77 + 12 41 - 1 5 ) + 5 4 log 6 + 41 5 - 5 4 log 5
    = 1 2 4 ( 52 + 12 41 ) - 1 2 4 ( 25 77 + 12 41 - 1 ) + 5 4 log 6 + 41 5 - 5 4 log 5
    = 1 4 ( 13 + 3 41 ) + 1 2 4 52 + 12 41 77 + 12 41 + 5 4 log 6 + 41 5 - 5 4 log 5
    = 1 4 ( 13 + 3 41 ) + 1 4 13 + 3 41 77 + 12 41 + 5 4 log 6 + 41 5 - 5 4 log 5
  2. d dt ( e 3 t , e - 3 t , 3 2 t ) = ( 3 e 3 t , - 3 e - 3 t , 3 2 )
    9 e 6 t + 9 e 6 t + 9 · 2 dt
    = 3 2 e 6 t + 2 dt
    = 3 2 e 6 t + 1 dt
    u = e 6 t
    d u dt = 6 e 6 t
    3 2 u d u 6 e 6 t
    = 3 2 6 u u d u
    = 3 2 6 1 u d u
    = 3 2 6 · 2 u
    = 2 u
    t = 0 , 1 3 u = 6 , 6 e 2
    2 ( 6 e 2 - 6 ) = 2 3 ( e - 1 )

コード

#!/usr/bin/env python3
from unittest import TestCase, main
from sympy import Matrix, Derivative, Rational, log, Integral, sqrt, exp
from sympy.plotting import plot3d_parametric_line
from sympy.abc import t

print('3.')

Xa = Matrix([t, 2 * t, t ** 2])
Xa1 = Derivative(Xa, t, 1).doit()
tsa = (1, 3)
Xb = Matrix([exp(3 * t), exp(-3 * t), 3 * sqrt(2) * t])
Xb1 = Derivative(Xb, t, 1).doit()
tsb = (0, Rational(1, 3))


class Test(TestCase):
    def test_a(self):
        self.assertEqual(
            float(Integral(Xa1.norm(), (t, *tsa)).doit()),
            float(
                (13 + 3 * sqrt(41)) / 4 +
                (13 + 3 * sqrt(41)) / (4 * (77 + 12 * sqrt(41))) +
                5 * log((6 + sqrt(41)) / sqrt(5)) / 4 - 5 * log(sqrt(5)) / 4
            )
        )


p = plot3d_parametric_line(
    (*Xa, (t, -5, 1)),
    (*Xa, (t, 1, 3)),
    (*Xa, (t, 3, 5)),
    show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']
for o, color in zip(p, colors):
    o.line_color = color
    print(o, color)
p.xlabel = 'x'
p.ylabel = 'y'
p.save('sample3_a.png')
p = plot3d_parametric_line(
    (*Xb, (t, -1, 0)),
    (*Xb, (t, 0, Rational(1, 3))),
    (*Xb, (t, Rational(1, 3), 1)),
    show=False)
for o, color in zip(p, colors):
    o.line_color = color
    print(o, color)
p.xlabel = 'x'
p.ylabel = 'y'
p.save('sample3_b.png')
p.show()


if __name__ == "__main__":
    main()

入出力結果

% ./sample3.py -v
3.
3D parametric cartesian line: (t, 2*t, t**2) for t over (-5.0, 1.0) red
3D parametric cartesian line: (t, 2*t, t**2) for t over (1.0, 3.0) green
3D parametric cartesian line: (t, 2*t, t**2) for t over (3.0, 5.0) blue
3D parametric cartesian line: (exp(3*t), exp(-3*t), 3*sqrt(2)*t) for t over (-1.0, 0.0) red
3D parametric cartesian line: (exp(3*t), exp(-3*t), 3*sqrt(2)*t) for t over (0.0, 0.3333333333333333) green
3D parametric cartesian line: (exp(3*t), exp(-3*t), 3*sqrt(2)*t) for t over (0.3333333333333333, 1.0) blue
test_a (__main__.Test) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.252s

OK
%