Importing JS module for CustomJS

I am pretty new to Bokeh and Javascript and currently experimenting with CustomJS.
Since I want to export a Jupyter Notebook containing interactive Bokeh content without using Bokeh server, I cannot use Python functions.
Therefore, to make calculations less tedious, I am using mathjs module to make calculations on arrays.
Unfortunately, after creating the html file, the following JS callback code doesn’t work :

function linspace(startValue, stopValue, number) {
        var arr = [];
        var step = (stopValue - startValue) / (number - 1);
        for (var i = 0; i < number; i++) {
            arr.push(startValue + (step * i));
        return arr;
    var x =['x']
    var y =['y']
    var t = linspace(0,cb_obj.value,cb_obj.value*10)

    //Calculates the trajectory till time t
    traj_x = (v_0, alpha, t) => math.multiply(v_0,math.cos(alpha),t)
    traj_y = (v_0, alpha, t) => math.add(math.multiply(-0.5, g, => x ** 2)), math.multiply(v_0, math.sin(alpha), t))

    x = traj_x(v_0, alpha, t)
    y = traj_y(v_0, alpha, t)


Even though I have imported mathjs at the beginning of the html with the following :
<script src=""integrity="sha512-rCvDXOM8HOkDDjC0l9vQPhUg2n0rKlcsCtDjWG0ajYmVfjgtO6egt/RdSbKSzFCIUaE/OQRwmiU/4PmOeK3J+Q=="crossorigin="anonymous"></script>
When I go into the console I get : Uncaught ReferenceError: math is not defined
I tried putting :

const math = window.mathjs;

at the beginning of the CustomJS code without success.
I also tried importing the module from a local path, no succes either.

So my question : how do I import a JS module from a CDN link into the html file to make it work in the CustomJS callback ?
Thanks !