%hide
var('x_0')
y(x) = (x - x_0) ** 3 / 6 * unit_step(x - x_0) - (1 - x_0) * x ** 3 / 6 + x_0 * (1 - x_0) * (2 - x_0) * x / 6
@interact
def _(x_0=(0.25, (0, 1))):
p = plot(-y(x_0=x_0), (x, 0, 1))
p += plot(-y(x_0=0.5), (x, 0, 1), color='red')
p += line([(x_0, 0), (x_0, -y(x_0, x_0=x_0))], color='gray')
show(p)
|
|
Click to the left again to hide and once more to show the dynamic interactive window
|