



from __future__ import annotations

from collections.abc import Callable






def 	__UpperCAmelCase					(       snake_case_  :  List[Any]   ,	snake_case_  :  Any   ,	snake_case_  :  Tuple   ,	snake_case_  :  Dict = 100   ,	)							->	str:






   """simple docstring"""


   _lowerCAmelCase					     =		x_start
   _lowerCAmelCase					     =		fnc(snake_case_   )
   _lowerCAmelCase					     =		0.0

   for _ in range(snake_case_   ):
      # Approximates small segments of curve as linear and solve
      # for trapezoidal area
      _lowerCAmelCase					     =		(x_end - x_start) / steps + xa
      _lowerCAmelCase					     =		fnc(snake_case_   )
      area += abs(fxa + fxa   ) * (xa - xa) / 2

      # Increment step
      _lowerCAmelCase					     =		xa
      _lowerCAmelCase					     =		fxa
   return area


if __name__ == "__main__":






  def 	__UpperCAmelCase					(       snake_case_  :  Optional[int]   )							->	Union[str, Any]:






     """simple docstring"""


     return x**3

  print('''f(x) = x^3''')
  print('''The area between the curve, x = -10, x = 10 and the x axis is:''')
  SCREAMING_SNAKE_CASE				:     Any          =	1_0
  while i <= 1_0_0_0_0_0:
    SCREAMING_SNAKE_CASE				:     Any          =	trapezoidal_area(f, -5, 5, i)
    print(F'with {i} steps: {area}')
    i *= 1_0




"""simple docstring"""





def 	__UpperCAmelCase					(       snake_case_  :  float   )							->	int:






   """simple docstring"""


   return int(snake_case_   ) if x - int(snake_case_   ) <= 0 else int(snake_case_   ) + 1


if __name__ == "__main__":
  import doctest

  doctest.testmod()