


"""simple docstring"""



from __future__ import annotations

from collections.abc import Callable







def   __lowerCAmelCase						(						lowercase  :  Callable[[int | float], int | float]						,							lowercase  :  int | float						,							lowercase  :  int | float						,							lowercase  :  int = 100						,							)     ->						float:


    """simple docstring"""





    snake_case   :				Union[str, Any]				 =   x_start
    snake_case   :				List[Any]				 =   fnc(lowercase			)
    snake_case   :				str				 =   0.0
    for _ in range(lowercase			):
        # Approximates small segments of curve as linear and solve
        # for trapezoidal area
        snake_case   :				List[Any]				 =   (x_end - x_start) / steps + xa
        snake_case   :				Optional[int]				 =   fnc(lowercase			)
        area += abs(fxa + fxa			) * (xa - xa) / 2
        # Increment step
        snake_case   :				Any				 =   xa
        snake_case   :				str				 =   fxa
    return area


if __name__ == "__main__":







  def   __lowerCAmelCase						(						lowercase  :  int			)     ->						Tuple:


      """simple docstring"""





      return x**3 + x**2

  print("""f(x) = x^3 + x^2""")
  print("""The area between the curve, x = -5, x = 5 and the x axis is:""")
  __snake_case             =   10
  while i <= 100000:
    print(F'''with {i} steps: {trapezoidal_area(f, -5, 5, i)}''')
    i *= 10









"""simple docstring"""



import math
import sys







def   __lowerCAmelCase						(						lowercase  :  int			)     ->						int:


    """simple docstring"""





    if number != int(lowercase			):
        raise ValueError("the value of input must be a natural number"			)
    if number < 0:
        raise ValueError("the value of input must not be a negative number"			)
    if number == 0:
        return 1
    snake_case   :				Optional[Any]				 =   [-1] * (number + 1)
    snake_case   :				str				 =   0
    for i in range(1						,							number + 1			):
        snake_case   :				List[Any]				 =   sys.maxsize
        snake_case   :				Union[str, Any]				 =   int(math.sqrt(lowercase			)			)
        for j in range(1						,							root + 1			):
            snake_case   :				List[str]				 =   1 + answers[i - (j**2)]
            snake_case   :				Optional[Any]				 =   min(lowercase						,							lowercase			)
        snake_case   :				Any				 =   answer
    return answers[number]


if __name__ == "__main__":
  import doctest

  doctest.testmod()





