Ask Your Question

Revision history [back]

You can define your function first, and then plot it:

sage: f(x) = ((1+x*I)^(1+5*I)).real()
sage: plot(f,x,0,5)

You can define your function first, and then plot it:

sage: f(x) = ((1+x*I)^(1+5*I)).real()
sage: plot(f,x,0,5)

Then,

sage: integral_numerical(f,0,1)

leads to an error. A workaround is to define your function f not as a symbolic expression, but as a lambda function:

sage: f = lambda x: ((1+x*I)^(1+5*I)).real()
sage: plot(f,x,0,5)
sage: integral_numerical(f,0,1)
(0.1786803251930374, 2.0932402003702034e-15)

You can define your function first, and then plot it:

sage: f(x) = ((1+x*I)^(1+5*I)).real()
sage: plot(f,x,0,5)

Then,But concerning your second question,

sage: integral_numerical(f,0,1)

leads to an error. A workaround is to define your function f not as a symbolic expression, but as a lambda function:

sage: f = lambda x: ((1+x*I)^(1+5*I)).real()
sage: plot(f,x,0,5)
sage: integral_numerical(f,0,1)
(0.1786803251930374, 2.0932402003702034e-15)