JSFiddle - React, Tailwind, and code Playground

by Cameron Bernhardt

JavaScript

var integ = prompt("Integral"), low = prompt("Lower bound"), high = prompt("Upper bound");

document.body.innerText = sumIt(high) - sumIt(low);

function sumIt(num){
    num = parseFloat(eval(num)).toFixed(1);
    return eval(integ.replace(/x/g, "(" + num + ")"));
}