Animation in Jupyter notebook

I only use Jupyter notebooks. If I want to make anamimation, the only way I know is somethinglike this:

anim = animate_pendulum(times1, X_werte, Y_werte)

This is VERY slow in rendering the animation.
Is there a faster way to do it?

Thanks a lot for any help!