지역 찾기에 관한 질문

Nov 14 2020

다음은 곡선 및 접선 플로팅에 대한 이전 질문 질문에 대한 링크입니다.

Point Fun1과 Fun2 사이의 곡선과 접선 사이의 영역을 어떻게 찾을 수 있는지 알고 싶습니다. 이것은 내가 한 일이지만 정확한지 확실하지 않습니다. 부분적 통합을 사용해야합니까?

    Clear[f, x, g]
    f[x_] = x^3
    g = f[1.2] + f'[1.2] (x - 1.2)
    Plot[{f[x], g}, {x, -5, 5}, PlotRange -> 20]
    NIntegrate[f[x], {x, -2.4, 1.4}]
    NIntegrate[f[x], {x, -2.4, 4.8}]

또한 점 Fun1을 간격 [-5,0)에서 15 개 위치로 이동하기 위해 조작 기능을 어떻게 작동시킬 수 있는지 알고 싶습니다. 또한 점이 이동할 때마다 Manipulate 기능을 사용하여 드로잉을 업데이트하는 방법을 배우고 싶습니다 (그림은 교차점의 접선을 보여줍니다)

    Manipulate[
    Plot[{f[x],l[x]}, {t, -x, x}, Filling -> Axis, 
    PlotRange -> {{-5, 10}, {-5, 10}}, N[Erf[x]]], {1.3, 0.5}]], {x,
    0.0001, 3}]

답변

2 kglr Nov 14 2020 at 07:07
ClearAll[f, t]
f[x_] := x^3
t[x0_][x_] := f[x0] + f'[x0] (x - x0)


With[{x0 = 2}, Plot[{f@x, t[x0]@x, ConditionalExpression[t[x0]@x, x <= x0 ]}, {x, -5, 5},
     PlotRange -> {{-5, 5}, {-80, 80}}, 
     Filling -> {1 -> {{3}, {None, LightBlue}}},
     PlotStyle -> {Automatic, Automatic, None},
     ImageSize -> Large,
     MeshFunctions -> {# &, f@# - t[x0]@# &},  Mesh -> {{x0}, {0}}, 
     MeshStyle -> Directive[PointSize@Large, Red], 
     DisplayFunction -> (Show[#, 
      Epilog -> First@Cases[Normal@#, 
         p_Polygon :> Text[Style[ Column[{"area:", Area[p]}, Alignment -> Center],
             14], RegionCentroid[p]], All]] &)]] 

Manipulate[Plot[{f@x, t[x0]@x, ConditionalExpression[t[x0]@x, -8 < x <= x0 ]}, 
  {x, -8, 5}, 
  PlotRange -> {{-8, 8}, {-220, 70}}, 
  Filling -> {1 -> {{3}, {None, LightBlue}}},
  PlotStyle -> {Automatic, Automatic, None},
  ImageSize -> Large,
  MeshFunctions -> {# &, f@# - t[x0]@# &},  
  Mesh -> {{x0}, {0}}, 
  MeshStyle -> Directive[PointSize[Large], Red], 
  DisplayFunction -> (Show[# , 
      Epilog -> {Text[Style[Round[#, .1], 16, Black], #, {-1, 3/2}] & /@ 
         Cases[Normal@#, Point[x_] :> x, All][[;; 2]]},  
      PlotLabel -> Style[PromptForm["shaded area", 
         First @ Cases[Normal@#, p_Polygon :> Area[p], All]], 20]] &)],
 {{x0, 2}, 0, 3, .1}]