code: def main():
      print()
      print(
          "Applying perturbation theory to calculate the ground state energy"
      )
      print("of the infinite 1D box of width ``a`` with a perturbation")
      print(
          "which is linear in ``x``, up to second order in perturbation."
      )
      print()
  
      x, _a = var("x _a")
      perturbation = 0.1 * x / _a
  
      E1 = energy_corrections(perturbation, 1)
      print("Energy for first term (n=1):")
      print("E_1^{(0)} = ", E1[0])
      print("E_1^{(1)} = ", E1[1])
      print("E_1^{(2)} = ", E1[2])
      print()
  
      E2 = energy_corrections(perturbation, 2)
      print("Energy for second term (n=2):")
      print("E_2^{(0)} = ", E2[0])
      print("E_2^{(1)} = ", E2[1])
      print("E_2^{(2)} = ", E2[2])
      print()
  
      E3 = energy_corrections(perturbation, 3)
      print("Energy for third term (n=3):")
      print("E_3^{(0)} = ", E3[0])
      print("E_3^{(1)} = ", E3[1])
      print("E_3^{(2)} = ", E3[2])
      print()
  
imports: from sympy.core import pi
  from sympy import Integral, var, S
  from sympy.functions import sin, sqrt
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types