I am trying to plot a simple function in python ( x + sqrt(x^2 + 2x) ). Here is my code:
import pylab as pl
import numpy as np
import math
X = np.linspace(-999999,999999)
Y = (X+math.sqrt(X**2+2*X))
pl.plot(X,Y)
pl.show()
Here is the error that I am facing: TypeError: only length -1 arrays can be converted to Python scalars