title: Antiderivative integral
body: <p>Please tell me how to implement in python the integral shown in the figure <a href="https://i.stack.imgur.com/vUvvZ.png" rel="nofollow noreferrer">1</a> (or lines 18-19 in the code)?</p>
  <p>Tried through sympy.integrate but failed - ValueError: Invalid limits specified: (20.665,)</p>
  <pre><code>import numpy as np
  import sympy
  from scipy import interpolate
  
  b_2 = 6.67
  l_k = 24.0
  U_1 = [0.0, 4.3, 8.1, 11.4, 14.1, 16.3, 18.0, 19.3, 20.2, 20.7]
  V_1 = [0.0, 0.6, 1.8, 3.5, 5.7, 8.3, 11.3, 14.8, 18.6, 22.8]
  
  &quot;The first derivative of the centroid equation&quot;
  def Cn_1(x):
      x_points = U_1
      y_points = V_1
  
      tck = interpolate.splrep(x_points, y_points)
      return interpolate.splev(x, tck, der = 1)
  
  
  &quot;Calculating the length of the centroid depending on the X coordinate &quot;
  def l_cn(x):
          return sympy.integrate((1 + Cn_1(x)**2)**0.5, x)
  
  
  &quot;Full centroid length&quot;
  L_max = l_cn(l_k - 0.5 * b_2)
  print(&quot;L_max = &quot;, L_max)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/vUvvZ.png" rel="nofollow noreferrer">Image of a piece of code written in MathCad 2000 that I am trying to port to Python</a></p>
  <p><a href="https://i.stack.imgur.com/l8EJy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l8EJy.png" alt="enter image description here" /></a></p>