WebCAS - Computer algebra in the browser

Applications

WebCAS:
Computer algebra in the browser

Computer algebra is one of the oldest applications of procedural or rules-based artificial intelligence. Maxima, of course, serves as a perfect example of a computer algebra system (CAS): it is also one of the oldest pieces of software still actively maintained and used worldwide. However, like other similarly sophisticated, complex software applications, it is a bit unwieldy: It requires installation on the user's computer and active maintenance as new versions are released. It is also not particularly well-suited for use on handheld or mobile devices.

At the same time, the level of sophistication that characterizes a top-tier CAS is often not needed by many users. To do (relatively) simple algebra, compute an integral or plot a function, only a small subset of the capabilities of a CAS are exercised.

The application featured on this page, born in part as a software development experiment using current (as of late 2026) top-tier large language models (see below), answers this need.

As the name implies, WebCAS is, well, a Web-based computer algebra system. While it lacks the sophistication of a mature, frontier-class CAS, it is a full-featured application on its own right, eminently usable even for moderately complex tasks.

In addition to its mathematical capabilities, WebCAS also provides results in a form that can be readily copy-pasted into LaTeX documents. Alternatively, a notebook can be saved as a LaTeX file, ready to be compiled with pdflatex.

The image capture included here demonstrates the use of WebCAS evaluating, and then plotting, a somewhat non-trivial integral. This example should make it evident that WebCAS is not a toy: its capabilities may not match those of the frontier-class CAS applications, but it is a practical, usable tool nonetheless.

Use case: An example from general relativity

To demonstrate just how useful WebCAS is, its limitations notwithstanding, let us use it to derive the Schwarzschild solution of general relativity, i.e., the canonical "black hole" spacetime metric. Without further ado, here is the script:

lcs(g,c):=block(local d:=length(c),r:=table(zeros(d,d),k,1,d);
  for k from 1 to d do
    for l from 1 to d do
      for m from 1 to d do
        r[k][l][m]:=1/2*(diff(g[k][l],c[m])+diff(g[k][m],c[l])-diff(g[l][m],c[k]))
      end
    end
  end;
r);
mcs(g,c):=block(local G:=g^-1,L:=lcs(g,c); table(sum(G[k,l]*L[k],k,1,4),l,1,4));
R(g,c):=block(
  local d:=length(c),
        G:=mcs(g,c),
        R:=table(table(zeros(d,d),k,1,d),l,1,d);
  for k from 1 to d do
    for l from 1 to d do
      for m from 1 to d do
        for n from 1 to d do
          R[k][n][m][l]:=diff(G[k][l][m],c[n])-
                         diff(G[k][l][n],c[m])-
                         sum(G[a][l][n]*G[k][a][m],a,1,d)+
                         sum(G[a][l][m]*G[k][a][n],a,1,d)
        end
      end
    end
  end;
R);
depends([A,B],r);
lg:=diagmatrix([B,-A,-r^2,-r^2*sin(theta)^2])

coords:=[t,r,theta,phi]

S:=simplify(sum(R(lg,coords)[k][k],k,1,4).lg^-1);
E:=simplify(S-1/2*trace(S)*identity(4))

T:=solve(exp(logcombine(subst(C1=log(2*G*M),dsolve(numer(E[1,1])=0,A)),"positive")),A)

densityplot(subst([G=1/(10*M),r=sqrt(x^2+y^2)],rhs(T[1])),[x,-10,10],[y,-10,10])

These five chunks of code can be copy-pasted into WebCAS one chunk at a time, as indicated by the extra line breaks above.

The script contains a generic function to calculate the Christoffel symbols of the first and second kind (lcs and mcs) and the Riemann tensor R; then, a generic spherical metric is postulated by means of the unknown functions A and B of the radial coordinate r. Next, the Ricci tensor S and the Einstein tensor E are computed. Solving for E[1,1]=0 (vacuum solution) yields the well-known form of the Schwarzschild metric. Finally, the solution is plotted as a density plot.

Building complex applications with LLM help

Needless to say one does not build a 26,000-line software application overnight without help. WebCAS was built using Claude Opus 5.5. However, Claude was not used in an "agentic" role, where the AI would take over the process of development and testing.

Rather, in the process that was followed, the human retained the role of senior developer. The AI was used in chat mode as an extremely capable and knowledgeable assistant, but the development process remained under human direction, and integration and testing was also performed by the human user.

While this approach may seem somewhat inefficient, it ensures that the human developer remains very much in the loop, with full understanding of the software architecture and its quirks, rather than being relegated to a more distant "project manager" type of role.

What made this project possible is the extremely generous input context window size of modern language models. Claude Opus 5.5 has a 1-million token input limit. The final context size of the WebCAS development conversation consumed almost 800,000 tokens, maximally epxloiting this frontier model's capabilities.

elizaGPT... »