MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • Planning your next Emirates flight? Visit the  for a smooth, face-to-face booking experience. The friendly staff can help you choose the best itinerary, customize your travel preferences, and answer any queries. Whether you're traveling for business or leisure, you'll get personalized support that makes planning your journey easier and more efficient than ever before.

    Maplesoft now has a new approach to providing customer support for Maple users! The Maple Customer Support Updates allows Maplesoft to provide important updates to our customers as fast as possible. These updates contain a series of improvements and fixes to any area of the Maple library, enabling a rapid response for customer reports and requests. When a Maple user reports a bug or weakness, or requests some missing functionality that can be addressed with an update to the Maple library, such an update can now be provided immediately after the fix or improvement is developed. Furthermore, the update will not just be available to that customer who reported it, but also to any other Maple users who wishes to use them. Of course, not all reports will be able to be addressed quickly, and for those that are, it will be up to the developer's discretion whether to make the fix or improvement available via these new Maple Customer Support Updates. Please note that these Updates may contain experimental elements that could change in subsequent official releases.

    The updates are available as a workbook containing a Maple library file that can be downloaded and installed from the Maple Cloud. To install the Maple Customer Support Updates from the Maple Cloud,

    • Click the MapleCloud icon in the upper-right corner of the Maple GUI window and select Packages.
    • Find the Maple Customer Support Updates package and click the Install button, the last one under Actions.
    • To check for new versions of Maple Customer Support Updates, click the MapleCloud icon and select Updates. If the cloud icon in the Actions column of Maple Customer Support Updates has the word Update beside it, then you can click on it to download a new update.

    To make the process of installing and maintaining the Maple Customer Support Updates as smooth as possible, we've also introduced a new Maple library package, SupportTools, with 3 commands, Update, Version, and RemoveUpdates.

    Load the SupportTools package:
    with(SupportTools)

    [RemoveUpdates, Update, Version]

    (1)

    Check which version is currently installed:
    Version()

    `The Customer Support Updates version in the MapleCloud is 10. The version installed in this computer is 9 created April 22, 2025, 15:14 hours Eastern Time, found in the directory C:\Users\Austin\Maple\toolbox\2025\Maple Customer Support Updates\lib\Maple`

    (2)


    Update to the latest version (you could also call Update(latest)):

    Update()

    Warning, You have just upgraded from version 9 to version 10 of the Customer Support Updates. In order to have this version active, please close Maple entirely, then open Maple and enter SupportTools:-Version() to confirm the active version.

     


    Check the version again:

    Version()

    `The Customer Support Updates version in the MapleCloud is 10 and is the same as the version installed in this computer, created April 22, 2025, 15:14 hours Eastern Time.`

    (3)


    Remove all updates for this release of Maple (except for those installing the SupportTools package itself):

    RemoveUpdates()RemoveUpdates()

    Warning, You have just reverted to version 4 of the Customer Support Updates. This version contains no actual updates other than the SupportTools package itself. In order to verify this, please close Maple entirely, then open Maple and enter SupportTools:-Version() to verify that the version number is 4.

     


    Note: You can also specify which version to install by supplying the version number as the argument to the Update command:

    Update(10)

    Warning, You have just upgraded from version 4 to version 10 of the Customer Support Updates. In order to have this version active, please close Maple entirely, then open Maple and enter SupportTools:-Version() to confirm the active version.

     

    Download SupportTools.mw

    In Maple 2025.0, the SupportTools package is not installed by default. For the first installation, you can also run the command
    PackageTools:-Install(4797495082876928); instead of installing it from the Maple Cloud.

    The Maple Customer Support Updates were inspired by and modelled after the existing Physics Updates which many Maple users may be famiilar with already. Going forward, Physics Updates will only contain changes to the Physics package itself. All other library updates will be available via the Maple Customer Support Updates. For compatibility with the pre-existing Physics:-Version command, calling SupportTools:-Version(n) is equivalent to calling SupportTools:-Update(n), and similarly SupportTools:-Version(latest) and SupportTools:-Update(latest) are both equivalent to the single call SupportTools:-Update().

    The procedure gives the bilinear form of a non-linear pde 
    Output is not quite in an easy-to-read notation yet , but will come later on as an option in the procedure call of bilinear ( , option) 
    Depends what further to do with the changed pde in Hirato D-operator form?..using a ansatz ( try function with reason) 

    with(PDEtools): with(DEtools):

    ## Hirota Bilinear Method
    ## Bilinear Derivative / Hirota Operator
    BD := proc(FF, DD)
        local f, g, x, m, opt;
        if nargs = 1 then
            return `*`(FF[]);
        fi;
        f, g := FF[];
        x, m := DD[];
        opt := args[3..-1];
        if m = 0 then
            return procname(FF, opt);
        fi;
        procname([diff(f, x), g], [x, m-1], opt) - procname([f, diff(g, x)], [x, m-1], opt);
    end:

    `print/BD` := proc(FF, DD)
        local f, g, x, m, i;
        f, g := FF[];
        f := cat(f, ` `, g);
        g := product(D[args[i][1]]^args[i][2], i = 2..nargs);
        if g <> 1 then
            f := ``(g)*``(f);
        fi;
        f;
    end:

    ## collect(expr, f); first!
    getFnumer := proc(df, f, pow::posint := 1)
        local i, g, fdenom;
        if type(df, `+`) then
            g := [op(df)];
            fdenom := map(denom, g);
            for i to nops(fdenom) while fdenom[i] <> f^pow do
            od;
            if i > nops(fdenom) then
                lprint(fdenom);
                error "no term(s) or numer=0 when denom=%1", op(0, f)^pow;
            fi;
            g := numer(g[i]);
            if not type(expand(g), `+`) then
                lprint(g);
                error "Expected more than 1 term about Hirota D-operator";
            fi;
            return g;
        fi;
        lprint(df);
        error "expected 1st argument be type `+`.";
    end:

    getvarpow := proc(df::function)
        local i, f, var, dif, pow;
        if op(0, df) <> diff then
            lprint(df);
            error "expected diff function";
        fi;
        f := convert(df, D);
        var := [op(f)];
        dif := [op(op([0, 0], f))];
        pow := [0$nops(var)];
        f := op(op(0, f))(var[]);
        for i to nops(var) do
            dif := selectremove(member, dif, {i});
            pow[i] := nops(dif[1]);
            dif := dif[2];
        od;
        pow := zip((x, y) -> [x, y], var, pow);
        pow := remove(has, pow, {0});
        [[f, f], pow[]];
    end:

    #convert to Hirota Bilinear Form
    HBF := proc(df)
        local i, c, f;
        if type(df, `+`) then
            f := [op(df)];
            return map(procname, f);
        fi;
        if type(df, `*`) then
            f := [op(df)];
            f := selectremove(hasfun, f, diff);
            c := f[2];
            f := f[1];
            if nops(f) <> 1 then
                lprint(df);
                error "need only one diff function factor.";
            fi;
            f := f[];
            c := `*`(c[]);
            f := getvarpow(f);
            f := [c, f];
            return f;
        fi;
        if op(0, df) = diff then
            f := getvarpow(df);
            f := [1, f];
            return f;
        fi;
        lprint(df);
        error "unexpected type.";
    end:

    printHBF := proc(PL::list)
        local j, DD, f, C, tmp, gcdC, i;
        C := map2(op, 1, PL);
        gcdC := 1;
        if nops(C) > 1 then
            tmp := [seq(cat(_Z, i), i = 1..nops(C))];
            gcdC := tmp *~ C;
            gcdC := `+`(gcdC[]);
            gcdC := factor(gcdC);
            tmp := selectremove(has, gcdC, tmp);
            gcdC := tmp[2];
            if gcdC = 0 then
                gcdC := 1;
            fi;
            gcdC := gcdC*content(tmp[1]);
        fi;
        if gcdC <> 1 then
            C := C /~ gcdC;
        fi;
        DD := map2(op, 2, PL);
        f := op(0, DD[1][1][1]);
        DD := map(z -> product(D[z[i][1]]^z[i][2], i = 2..nops(z)), DD);
        DD := zip(`*`, C, DD);
        DD := `+`(DD[]);
        gcdC * ``(DD) * cat(f, ` `, f);
    end:

    ## print Hirota Bilinear Transform
    printHBT := proc(uf, u, f, i, j, PL, alpha := 1)
        local DD, g, C, tmp, pl;
        pl := printHBF(PL);
        if j > 0 then
            print(u = 2*alpha*'diff'(ln(f), x$j));
        else
            print(u = 2*alpha*ln(f));
        fi;
        if i > 0 then
            print('diff'(pl/f^2, x$i) = 0);
        else
           print(pl/f^2 = 0);
        fi;
        NULL;
     end:

    guessdifforder := proc(PL::list, x::name)
        local L, minorder, maxorder, tmp;
        L := map2(op, 2, PL);
        L := map(z -> z[2..-1], L);
        tmp := map(z -> map2(op, 2, z), L);
        tmp := map(z -> `+`(z[]), tmp);
        tmp := selectremove(type, tmp, even);
        minorder := 0;
        if nops(tmp[1]) < nops(tmp[2]) then
            minorder := 1;
        fi;
        tmp := map(z -> select(has, z, {x}), L);
        tmp := map(z -> map2(op, 2, z), tmp);
        if has(tmp, {[]}) then
            maxorder := 0;
        else
            tmp := map(op, tmp);
            maxorder := min(tmp[]);
        fi;
        if type(maxorder - minorder, odd) then
            maxorder := maxorder - 1;
        fi;
        [minorder, maxorder];
    end:

    guessalpha := proc(Res, uf, u, f, i, j, PL, alpha)
        local tmp, res, pl, flag, k;
        flag := 1;
        tmp := [op(Res)];
        tmp := map(numer, tmp);
        tmp := gcd(tmp[1], tmp[-1]);
        if type(tmp, `*`) then
            tmp := remove(has, tmp, f);
        fi;
        if tmp <> 0 and has(tmp, {alpha}) then
            tmp := solve(tmp/alpha^difforder(uf), {alpha});
            if tmp <> NULL and has(tmp, {alpha}) then
                lprint(tmp);
                for k to nops([tmp]) while flag = 1 do
                    res := collect(expand(subs(tmp[k], Res)), f, factor);
                    if res = 0 then
                        pl := subs(tmp[k], PL);
                        printHBT(uf, u, f, i, j, pl, rhs(tmp[k]));
                        flag := 0;
                    fi;
                od;
            fi;
        fi;
        PL;
    end:

    Bilinear := proc(uf, u, f, x, alpha)
        local su, h, i, j, g1, CB, PL, gdo, DD, Res;
        if hasfun(uf, int) then
            error "Do not support integral function yet. Please substitute int function.";
        fi;
        for j from 0 to 2 do
            Res := 1;
            su := u = 2*alpha*diff(ln(f), [x$j]);
            h := collect(expand(dsubs(su, uf)), f, factor);
            if hasfun(h, ln) then
                next;
            fi;
            g1 := getFnumer(h, f)/2;
            g1 := expand(g1);
            CB := HBF(g1);
            gdo := guessdifforder(CB, x);
            for i from gdo[1] by 2 to gdo[2] do
                if i = 0 then
                    PL := CB;
                else
                    PL := HBF(int(g1, x$i));
                fi;
                DD := add(PL[i][1]*BD(PL[i][2][]), i = 1..nops(PL));
                Res := collect(expand(diff(DD/f^2, [x$i]) - h), f, factor);
                if Res = 0 then
                    printHBT(uf, u, f, i, j, PL, alpha);
                    break;
                elif type(alpha, name) and has(DD, alpha) then
                    Res := guessalpha(Res, uf, u, f, i, j, PL, alpha);
                fi;
            od;
            if Res = 0 then
                break;
            fi;
        od;
        PL;
    end:

    with(PDEtools):

    # Definieer de Boussinesq vergelijking
    boussinesq := diff(u(x,t),t,t) - diff(u(x,t),x,x) - 3*diff(u(x,t),x,x)^2 - diff(u(x,t),x$4);

    # Pas de bilineaire transformatie toe
    Bilinear(boussinesq, u(x,t), f(x,t), x, alpha);

    diff(diff(u(x, t), t), t)-(diff(diff(u(x, t), x), x))-3*(diff(diff(u(x, t), x), x))^2-(diff(diff(diff(diff(u(x, t), x), x), x), x))

     

    {alpha = 1}

     

    u(x, t) = 2*ln(f(x, t))

     

    ``(-D[x]^4+D[t]^2-D[x]^2)*`f f`/f(x, t)^2 = 0

     

    [[-alpha, [[f(x, t), f(x, t)], [x, 4]]], [alpha, [[f(x, t), f(x, t)], [t, 2]]], [-alpha, [[f(x, t), f(x, t)], [x, 2]]]]

    (1)

     

    # Definieer de Kadomtsev–Petviashvili (KP) vergelijking in één regel
    kp := diff(diff(u(x,y,t),x$3) + 6*u(x,y,t)*diff(u(x,y,t),x) + diff(u(x,y,t),t), x)
           + 3*delta^2*diff(u(x,y,t), y$2):
    Bilinear(kp, u(x,y,t), f(x,y,t), x, alpha);
     

    {alpha = 1}

     

    u(x, y, t) = 2*(diff(ln(f(x, y, t)), x, x))

     

    diff(``(3*delta^2*D[y]^2+D[x]^4+D[t]*D[x])*`f f`/f(x, y, t)^2, x, x) = 0

     

    [[alpha, [[f(x, y, t), f(x, y, t)], [x, 4]]], [alpha, [[f(x, y, t), f(x, y, t)], [x, 1], [t, 1]]], [3*alpha*delta^2, [[f(x, y, t), f(x, y, t)], [y, 2]]]]

    (2)

     

    printHBF := proc(PL::list) ? 

    Download dbilinear_proc_def_13-4-2025.mw

    In Statistics Library there is an error with PowerFit function. The summarize of results show R-Squared and Adjusted R-Squared with erroneal results. Please could you fix it?

    I teach math at the high school level.

    I am worried that Maple 2025 appears to be slower than Maple 2024 - in particular for students with older, less strong laptops.

    Maple 2025 takes 50% longer to start than Maple 2024 (or Maple 2025 Screen Reader which I expect to be using).

    So, on more sluggist student laptops I fear the slowness overall will be an issue - in particular as Maple regularly has to be shutdown and restarted for some of those students.

    Further, I really miss the "recompute section !" and the "magniffy" icons on the quest access bar. Having "recompute entire worksheet !!!" seems unwise though. I wish you could costumize the quest access bar.

    Overall, from a teaching point of view, I am not at all impressed, sadly.

    Just an observation.

    I was wondering if less obvious errors than in the below can be avoided with future versions of the AI assistant. Maybe a warning that a formula uses special Maple symbols is possible.

    Formulas without dimensions are more susceptible to undetected errors.

    Deflection of a circular cantilever

    (a first attemp with the AI formula assistant)

    _local(I)

    I

    (1)

    AI prompt: Deflection of a circular cantilever with a  force applied at the end

    Correct formular inserted ->
    delta = F*L^3/(3*E*I)

    delta = (1/3)*F*L^3/(E*I)

    (2)

    AI prompt:  Moment of inertia of a circular cross-section

    Correct formular inserted ->

    I = (1/4)*Pi*R^4

    I = (1/4)*Pi*R^4

    (3)

    subs(I = (1/4)*Pi*R^4, delta = (1/3)*F*L^3/(E*I))

    delta = (4/3)*F*L^3/(E*Pi*R^4)

    (4)

    params := R = 25*Unit('mm'), F = 200*Unit('N'), L = 1.*Unit('m'), E = 210000*Unit('N'/'mm'^2)

    R = 25*Units:-Unit(mm), F = 200*Units:-Unit(N), L = 1.*Units:-Unit(m), E = 210000*Units:-Unit(N/mm^2)

    (5)

    subs(R = 25*Units:-Unit(mm), F = 200*Units:-Unit(N), L = 1.*Units:-Unit(m), E = 210000*Units:-Unit(N/mm^2), delta = (4/3)*F*L^3/(E*Pi*R^4))

    delta = 0.1034759757e-8*Units:-Unit(N)*Units:-Unit(m)^3/(Units:-Unit(N/mm^2)*Units:-Unit(mm)^4)

    (6)

    simplify(%)

    delta = 0.1034759757e-2*Units:-Unit(m)

    (7)

    NULL

    The dimension of m^9 for a deflection clearly indicates an error.

    A better prompt to avoid this error (caused by automatic simplification) could not be found

    Download AI_formula_assistant.mw

    P.S.:

    This is a real example that happend to me where I did not notice the minus sign in Maples output in equation (1). The error  can easily be fixed by adding "local I" as the first statement of the document and the deflection becomes 1 mm.

    I don't have the latest Maple, and I'm sure this isn't in the latest version. 

    One thing that has been an annoyance for all time, and it gets me time and time again, is not having a global degrees or radians setting. 

    Of course it needs to be a setting option, otherwise it would break many older worksheets. 

    The Maplesoft Physics Updates, introduced over a decade ago, brought with them an innovative concept: to deliver fixes and new developments continuously, as soon as they enter the development version of the Maple library for the next release. A key aspect of this initiative was prioritizing the resolution of issues reported on MaplePrimes, ensuring that fixes became available to everyone within 24 to 48 hours. Initially focused solely on the Physics package, the scope of the updates quickly expanded to include other parts of the Maple library and the Typesetting system.

    This initiative, which I developed outside regular work hours, aimed to enhance the Maple experience—where issues encountered in daily use could be resolved almost immediately, minimizing disruptions and benefiting the entire user community through shared updates.

    As of January 1st, I have stepped away from my role at Maplesoft and have been increasingly involved in activities unrelated to Maple. This raises the question of what will happen with the Physics Updates for Maple 2025 and after.

    The Physics project remains a unique and personally meaningful endeavor for me. So, for now, I will continue to dedicate some time to these Updates—but only for the Physics package, not for other parts of the library. As before, these fixes and developments will be included in the Physics Updates only after they have been integrated into the development version of Maple’s official library for the next release. In that sense, they will continue to be Maplesoft updates.

    On that note, the first release of the Physics Updates for Maple 2025—focused solely on the Physics package—went out today as version 1854. To install it, the first time open Maple 2025 and use the Maplecloud toolbar -> Packages, or else input PackageTools:-Install(5137472255164416). Any next time, just enter Physics:-Version(latest)

    As for fixes beyond the Physics package, I understand that Maplesoft is exploring the possibility of offering something similar to what was previously delivered through the Maplesoft Physics Updates.

    All the best

    PS: to install the last version of the Maplesoft Physics Updates for Maple 2024, open Maple and input Physics:-Version(1852), not 1853.
     
    Edgardo S. Cheb-Terrab
    Physics, Differential Equations, and Mathematical Functions
    Maplesoft Emmeritus
    Research and Education—passionate about all that.

       So, someone just posted spam here. Cleverly designed, the title was an HTTP link that sent the reader to a .in website. Accessing the actual post was impossible, and marking it as spam was impossible as well. Debugging tools had to be used.

       The design of this website should be improved to make this impossible. An unalterable icon should be present to connect the reader to the post without relying on the user-defined title.

    What is new in Physics in Maple 2025

     

    This post is, basically, the page of what is new in Physics distributed with Maple 2025. Why post it? Because this time we achieved a result that is a breakthrough/milestone in Computer Algebra: for the first time we can systematically compute Einstein's equations from first principles, using a computer, starting from a Lagrangian for gravity. This is something to celebrate.

     

    Although being able to perform this computation on a computer algebra sheet is relevant mostly for physicists working in general relativity, the developments performed in the tensor manipulation and functional differentiation routines of the Maple system to cover this computation were tremendous, in number of lines of code, efforts and time, resulting in improvements not just fore general relativity but for physics all around, and in an area out of reach of neural network AIs . Other results, like the new routines for linearizing gravity, requested other times here in Mapleprimes, are also part of the relevant novelties.

     

     

    Lagrange Equations and simplification of tensorial expressions in curved spacetimes

    Linearized Gravity

    Relative Tensors

    New Physics:-Library commands

    See Also

     

     

     

    Lagrange Equations and simplification of tensorial expressions in curved spacetimes

     

     

    LagrangeEquations  is a Physics command introduced in 2023 taking advantage of the functional differentiation  capabilities of the Physics  package . This command can handle tensors  and vectors  of the Physics  package as well as derivatives using vectorial differential operators (see d_  and Nabla ), works by performing functional differentiation (see Fundiff ), and handles 1st, and higher order derivatives of the coordinates in the Lagrangian automatically. LagrangeEquations  receives an expression representing a Lagrangian and returns a sequence of Lagrange equations with as many equations as coordinates are indicated. The number of parameters can also be many. For example, in electrodynamics, the "coordinate" is a tensor field A[mu](x, y, z, t), there are then four coordinates, one for each of the values of the index mu, and there are four parameters x, y, z, t.

     

    New in Maple 2025, the "coordinates" can now also be the components of the metric tensor in a curved spacetime, in which case the equations returned are Einstein's equations. Also new, instead of a coordinate or set of them, you can pass the keyword EnergyMomentum, in which case the output is the conserved energy-momentum tensor of the physical model represented by the given Lagrangian L.

     

    Examples

     

    with(Physics)

    Setup(mathematicalnotation = true, coordinates = cartesian)

    [coordinatesystems = {X}, mathematicalnotation = true]

    (1)

    The lambda*Phi^4 model in classical field theory and corresponding field equations, as in previous releases

    CompactDisplay(Phi(X))

    Phi(x, y, z, t)*`will now be displayed as`*Phi

    (2)

    L := (1/2)*d_[mu](Phi(X))*d_[mu](Phi(X))-(1/2)*m^2*Phi(X)^2+(1/4)*lambda*Phi(X)^4

    (1/2)*Physics:-d_[mu](Phi(X), [X])*Physics:-d_[`~mu`](Phi(X), [X])-(1/2)*m^2*Phi(X)^2+(1/4)*lambda*Phi(X)^4

    (3)

    Lagrange's equations

    LagrangeEquations(L, Phi)

    Phi(X)^3*lambda-Phi(X)*m^2-Physics:-dAlembertian(Phi(X), [X]) = 0

    (4)

    New: The energy-momentum tensor can be computed as the Lagrange equations taking the metric as the coordinate, not equating to 0 the result, but multiplying the variation of the action "(delta S)/(delta g[]^(mu,nu))" by 2/sqrt(-%g_[determinant]) (in flat spacetimes sqrt(-%g_[determinant]) = 1). For that purpose, you can use the EnergyMomentum keyword. You can optionally indicate the indices to be used in the output as well as their covariant or contravariant character

    LagrangeEquations(L, EnergyMomentum[mu, nu])

    Physics:-EnergyMomentum[mu, nu] = (-(1/4)*lambda*Phi(X)^4+(1/2)*m^2*Phi(X)^2-(1/2)*Physics:-d_[`~beta`](Phi(X), [X])*Physics:-d_[beta](Phi(X), [X]))*Physics:-g_[mu, nu]+Physics:-d_[mu](Phi(X), [X])*Physics:-d_[nu](Phi(X), [X])

    (5)

    To further compute using the above as the definition for T[mu, nu], you can use the Define  command

    Define(Physics:-EnergyMomentum[mu, nu] = (-(1/4)*lambda*Phi(X)^4+(1/2)*m^2*Phi(X)^2-(1/2)*Physics[d_][`~beta`](Phi(X), [X])*Physics[d_][beta](Phi(X), [X]))*Physics[g_][mu, nu]+Physics[d_][mu](Phi(X), [X])*Physics[d_][nu](Phi(X), [X]))

    `Defined objects with tensor properties`

     

    {Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-EnergyMomentum[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (6)

    After which the system knows about the symmetry properties and the components of T[mu, nu]

    EnergyMomentum[definition]

    Physics:-EnergyMomentum[mu, nu] = (-(1/4)*lambda*Phi(X)^4+(1/2)*m^2*Phi(X)^2-(1/2)*Physics:-d_[`~beta`](Phi(X), [X])*Physics:-d_[beta](Phi(X), [X]))*Physics:-g_[mu, nu]+Physics:-d_[mu](Phi(X), [X])*Physics:-d_[nu](Phi(X), [X])

    (7)

    Library:-IsTensorialSymmetric(EnergyMomentum[mu, nu])

    true

    (8)

    EnergyMomentum[]

    Physics:-EnergyMomentum[mu, nu] = Matrix(%id = 36893488151952536988)

    (9)

    New: LagrangeEquations takes advantage of the extension of Fundiff  to compute functional derivatives in curved spacetimes introduced for Maple 2025, and so it also handles the case of a scalar field in a curved spacetime. Set for instance an arbitrary metric

    g_[arb]

    _______________________________________________________

     

    `Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

     

    `The arbitrary metric in coordinates `*[x, y, z, t]

     

    `Signature: `(`- - - +`)

     

    _______________________________________________________

     

    Physics:-g_[mu, nu] = Matrix(%id = 36893488152257720060)

    (10)

    For the action to be a true scalar in spacetime, the Lagrangian density now needs to be multiplied by the square root of the determinant of the metric

    L := sqrt(-%g_[determinant])*L

    (-%g_[determinant])^(1/2)*((1/2)*Physics:-d_[mu](Phi(X), [X])*Physics:-d_[`~mu`](Phi(X), [X])-(1/2)*m^2*Phi(X)^2+(1/4)*lambda*Phi(X)^4)

    (11)

    New: With the extension of the tensorial simplification algorithms for curved spacetimes, the Lagrange equations can be computed arriving directly to the compact form

    LagrangeEquations(L, Phi)

    Phi(X)^3*lambda-Phi(X)*m^2-Physics:-D_[kappa](Physics:-d_[`~kappa`](Phi(X), [X]), [X]) = 0

    (12)

    Comparing with the result (4) for the same Lagrangian in a flat spacetime, we see the only difference is that the dAlembertian  is now expressed in terms of covariant derivatives D_ .

     

    The EnergyMomentum  tensor is computed in the same way as when the spacetime is flat

    LagrangeEquations(L, EnergyMomentum[mu, nu])

    Physics:-EnergyMomentum[mu, nu] = (-(1/4)*lambda*Phi(X)^4+(1/2)*m^2*Phi(X)^2-(1/2)*Physics:-d_[`~beta`](Phi(X), [X])*Physics:-d_[beta](Phi(X), [X]))*Physics:-g_[mu, nu]+Physics:-d_[mu](Phi(X), [X])*Physics:-d_[nu](Phi(X), [X])

    (13)

    General Relativity

     

    New: the most significant development in LagrangeEquations is regarding General Relativity. It can now compute Einstein's equations directly from the Lagrangian, not using tabulated cases, and properly handling several (traditional or not) alternative ways of presenting the Lagrangian.

     

    Einstein's equations concern the case of a curved spacetime with metric g[mu, nu] as, for instance, the general case of an arbitrary metric set lines above. In the Lagrangian formulation, the coordinates of the problem are the components of the metric g[mu, nu], and as in the case of electrodynamics the parameters are the spacetime coordinates X^alpha. The simplest case is that of Einstein's equation in vacuum, for which the Lagrangian density is expressed in terms of the trace of the Ricci  tensor by

    L := sqrt(-%g_[determinant])*Ricci[alpha, `~alpha`]

    (-%g_[determinant])^(1/2)*Physics:-Ricci[alpha, `~alpha`]

    (14)

    Einstein's equations in vacuum:

    LagrangeEquations(L, g_[mu, nu])

    -(1/2)*Physics:-g_[mu, nu]*Physics:-Ricci[alpha, `~alpha`]+Physics:-Ricci[mu, nu] = 0

    (15)

    where in the above instead of passing g as second argument, we passed g[mu, nu] to get the equations using those free indices. The tensorial equation computed is also the definition of the Einstein  tensor

    Einstein[definition]

    Physics:-Einstein[mu, nu] = -(1/2)*Physics:-g_[mu, nu]*Physics:-Ricci[alpha, `~alpha`]+Physics:-Ricci[mu, nu]

    (16)

    The Lagrangian L used to compute Einstein's equations (15)  contains first and second derivatives of the metric. To see that, rewrite L in terms of Christoffel  symbols

    L__C := convert(L, Christoffel)

    (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda])

    (17)

    Recalling the definition

    Christoffel[definition]

    Physics:-Christoffel[alpha, mu, nu] = (1/2)*Physics:-d_[nu](Physics:-g_[alpha, mu], [X])+(1/2)*Physics:-d_[mu](Physics:-g_[alpha, nu], [X])-(1/2)*Physics:-d_[alpha](Physics:-g_[mu, nu], [X])

    (18)

    in L[C] the two terms containing derivatives of Christoffel symbols contain second order derivatives of g[mu, nu]. Now, it is always possible to add a total spacetime derivative to L[C] without changing Einstein's equations (assuming the variation of the metric in the corresponding boundary integrals vanishes), and in that way, in this particular case of L[C], obtain a Lagrangian involving only 1st order derivatives. The total derivative, expressed using the inert `&PartialD;` command to see it before the differentiation operation is performed, is

    TD := %d_[alpha](g_[`~mu`, `~nu`]*sqrt(-%g_[determinant])*(g_[`~alpha`, mu]*Christoffel[`~beta`, nu, beta]-Christoffel[`~alpha`, mu, nu]))

    %d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu]))

    (19)

    Adding this term to L[C], performing the `&PartialD;` differentiation operation and simplifying we get

    L__1 := L__C+TD

    (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda])+%d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu]))

    (20)

    L__1 := eval(L__1, %d_ = d_)

    (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda])+Physics:-d_[alpha](Physics:-g_[`~mu`, `~nu`], [X])*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])-(1/2)*Physics:-g_[`~mu`, `~nu`]*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])*%g_[determinant]*Physics:-g_[`~kappa`, `~lambda`]*Physics:-d_[alpha](Physics:-g_[kappa, lambda], [X])/(-%g_[determinant])^(1/2)+Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-d_[alpha](Physics:-Christoffel[`~beta`, beta, nu], [X])-Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X]))

    (21)

    L__1 := Simplify(L__1)

    (Physics:-Christoffel[alpha, beta, kappa]*Physics:-Christoffel[`~beta`, `~alpha`, `~kappa`]-Physics:-Christoffel[alpha, beta, `~alpha`]*Physics:-Christoffel[`~beta`, kappa, `~kappa`])*(-%g_[determinant])^(1/2)

    (22)

    which is a Lagrangian depending only on 1st order derivatives of the metric through Christoffel  symbols. As expected, the equations of motion resulting from this Lagrangian are the same Einstein equations computed in (15)

    LagrangeEquations(L__1, g_[mu, nu])

    -(1/2)*Physics:-Ricci[iota, `~iota`]*Physics:-g_[mu, nu]+Physics:-Ricci[mu, nu] = 0

    (23)

    To illustrate the new Maple 2025 tensorial simplification capabilities note that `&equiv;`(L[1], (Physics[Christoffel][alpha, beta, kappa]*Physics[Christoffel][`~beta`, `~alpha`, `~kappa`]-Physics[Christoffel][alpha, beta, `~alpha`]*Physics[Christoffel][`~beta`, kappa, `~kappa`])*(-%g_[determinant])^(1/2)) is no just L[C] ≡ (17) after discarding its two terms involving derivatives of Christoffel symbols. To verify this, split L[C] into the terms containing or not derivatives of Christoffel

    L__22, L__11 := selectremove(has, expand(L__C), d_)

    (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X]), (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]

    (24)

    Comparing, the total derivative TD≡ (19) is not just -L[22], but

    TD = -L__22-2*L__11

    %d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])) = -(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])+(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])-2*(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]+2*(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]

    (25)

    Things like these, TD = -L__22-2*L__11, can now be verified directly with the new tensorial simplification capabilities: take the left-hand side minus the right-hand side, evaluate the inert derivative `&PartialD;` and simplify to see the equality is true

    (lhs-rhs)(%d_[alpha](Physics[g_][`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu])) = -(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])+(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])-2*(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]+2*(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda])

    %d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu]))+(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+2*(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-2*(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]

    (26)

    eval(%d_[alpha](Physics[g_][`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu]))+(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])-(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])+2*(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]-2*(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda], %d_ = d_)

    (-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])*Physics:-d_[alpha](Physics:-g_[`~mu`, `~nu`], [X])-(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])*Physics:-g_[`~mu`, `~nu`]*%g_[determinant]*Physics:-g_[`~kappa`, `~lambda`]*Physics:-d_[alpha](Physics:-g_[kappa, lambda], [X])/(-%g_[determinant])^(1/2)+(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-d_[alpha](Physics:-Christoffel[`~beta`, beta, nu], [X])-Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X]))*Physics:-g_[`~mu`, `~nu`]+(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+2*(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-2*(-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]

    (27)

    Simplify((-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu])*Physics[d_][alpha](Physics[g_][`~mu`, `~nu`], [X])-(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu])*Physics[g_][`~mu`, `~nu`]*%g_[determinant]*Physics[g_][`~kappa`, `~lambda`]*Physics[d_][alpha](Physics[g_][kappa, lambda], [X])/(-%g_[determinant])^(1/2)+(-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[d_][alpha](Physics[Christoffel][`~beta`, beta, nu], [X])-Physics[d_][alpha](Physics[Christoffel][`~alpha`, mu, nu], [X]))*Physics[g_][`~mu`, `~nu`]+(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])-(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])+2*(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]-2*(-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda])

    0

    (28)

    That said, it is also true that TD = -L[22]-2*L[11] results in the Lagrangian L[1] = -L[11], and since the equations of movement don't depend on the sign of the Lagrangian, for this Lagrangian `&equiv;`(L[C], (-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*(Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])-Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])+Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]-Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda])) adding the term TD happens to be equivalent to just discarding the terms of L__C involving derivatives of Christoffel symbols.

     

    Also new in Maple 2025, due to the extension of Fundiff  to compute in curved spacetimes, it is now also possible to compute Einstein's equations from first principles by constructing the action,

    S := Intc(L, X)

    Int(Int(Int(Int((-%g_[determinant])^(1/2)*Physics:-Ricci[alpha, `~alpha`], x = -infinity .. infinity), y = -infinity .. infinity), z = -infinity .. infinity), t = -infinity .. infinity)

    (29)

    and equating to zero the functional derivative with respect to the metric. To avoid displaying the resulting large expression, end the input line with ":"

    EE__unsimplified := Fundiff(S, g_[alpha, beta]) = 0

    Simplifying this result, we get an expression in terms of Christoffel  symbols and its derivatives

    EEC := Simplify(EE__unsimplified)

    (1/4)*(2*Physics:-Christoffel[chi, iota, kappa]*Physics:-Christoffel[`~iota`, `~chi`, `~kappa`]-2*Physics:-Christoffel[chi, iota, `~chi`]*Physics:-Christoffel[`~iota`, kappa, `~kappa`]-2*Physics:-D_[iota](Physics:-Christoffel[chi, `~chi`, `~iota`], [X])+2*Physics:-D_[chi](Physics:-Christoffel[`~chi`, iota, `~iota`], [X]))*Physics:-g_[`~alpha`, `~beta`]+(1/4)*(Physics:-Christoffel[`~alpha`, chi, `~beta`]+Physics:-Christoffel[`~beta`, chi, `~alpha`])*Physics:-Christoffel[`~chi`, iota, `~iota`]-(1/4)*Physics:-Christoffel[`~beta`, chi, iota]*Physics:-Christoffel[`~chi`, `~alpha`, `~iota`]-(1/2)*Physics:-Christoffel[chi, iota, `~alpha`]*Physics:-Christoffel[`~iota`, `~beta`, `~chi`]+(1/2)*Physics:-Christoffel[chi, `~alpha`, `~beta`]*Physics:-Christoffel[iota, `~chi`, `~iota`]-(1/4)*Physics:-Christoffel[`~alpha`, chi, iota]*Physics:-Christoffel[`~chi`, `~beta`, `~iota`]+(1/4)*Physics:-D_[chi](Physics:-Christoffel[`~alpha`, `~beta`, `~chi`], [X])+(1/4)*Physics:-D_[chi](Physics:-Christoffel[`~beta`, `~alpha`, `~chi`], [X])-(1/2)*Physics:-D_[chi](Physics:-Christoffel[`~chi`, `~alpha`, `~beta`], [X])-(1/4)*Physics:-D_[`~alpha`](Physics:-Christoffel[`~beta`, chi, `~chi`], [X])+(1/2)*Physics:-D_[`~beta`](Physics:-Christoffel[chi, `~alpha`, `~chi`], [X])-(1/4)*Physics:-D_[`~beta`](Physics:-Christoffel[`~alpha`, chi, `~chi`], [X]) = 0

    (30)

    In this result, we see`&dtri;` derivatives of Christoffel  symbols, expressed using the D_  command for covariant differentiation. Although, such objects have not the geometrical meaning of a covariant derivative, computationally, they here represent what would be a covariant derivative if the Christoffel symbols were a tensor. For example,

    "`&dtri;`[chi](GAMMA[]^(alpha,beta,chi)) :"

    % = expand(%)

    Physics:-D_[chi](Physics:-Christoffel[`~alpha`, `~beta`, `~chi`], [X]) = Physics:-d_[chi](Physics:-Christoffel[`~alpha`, `~beta`, `~chi`], [X])+Physics:-Christoffel[`~alpha`, chi, mu]*Physics:-Christoffel[`~mu`, `~beta`, `~chi`]+Physics:-Christoffel[`~beta`, chi, mu]*Physics:-Christoffel[`~alpha`, `~chi`, `~mu`]+Physics:-Christoffel[`~chi`, chi, mu]*Physics:-Christoffel[`~alpha`, `~beta`, `~mu`]

    (31)

    With this computational meaning for the`&dtri;` derivatives of Christoffel symbols appearing in (30), rewrite EEC(30) in terms of the Ricci  and Riemann  tensors. For that, consider the definition

    Ricci[definition]

    Physics:-Ricci[mu, nu] = Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-d_[nu](Physics:-Christoffel[`~alpha`, mu, alpha], [X])+Physics:-Christoffel[`~beta`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, alpha]-Physics:-Christoffel[`~beta`, mu, alpha]*Physics:-Christoffel[`~alpha`, nu, beta]

    (32)

    Rewrite the noncovariant derivatives `&PartialD;` in terms of`&dtri;` derivatives using the computational representation (31), simplify and isolate one of them

    convert(Physics[Ricci][mu, nu] = Physics[d_][alpha](Physics[Christoffel][`~alpha`, mu, nu], [X])-Physics[d_][nu](Physics[Christoffel][`~alpha`, mu, alpha], [X])+Physics[Christoffel][`~beta`, mu, nu]*Physics[Christoffel][`~alpha`, beta, alpha]-Physics[Christoffel][`~beta`, mu, alpha]*Physics[Christoffel][`~alpha`, nu, beta], D_)

    Physics:-Ricci[mu, nu] = Physics:-D_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-Christoffel[`~alpha`, alpha, kappa]*Physics:-Christoffel[`~kappa`, mu, nu]+Physics:-Christoffel[`~kappa`, alpha, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]+Physics:-Christoffel[`~kappa`, alpha, nu]*Physics:-Christoffel[`~alpha`, mu, kappa]-Physics:-D_[nu](Physics:-Christoffel[`~alpha`, alpha, mu], [X])-Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~alpha`, alpha, lambda]+Physics:-Christoffel[`~beta`, mu, nu]*Physics:-Christoffel[`~alpha`, alpha, beta]-Physics:-Christoffel[`~beta`, alpha, mu]*Physics:-Christoffel[`~alpha`, beta, nu]

    (33)

    Simplify(Physics[Ricci][mu, nu] = D_[alpha](Physics[Christoffel][`~alpha`, mu, nu], [X])-Physics[Christoffel][`~alpha`, alpha, kappa]*Physics[Christoffel][`~kappa`, mu, nu]+Physics[Christoffel][`~kappa`, alpha, mu]*Physics[Christoffel][`~alpha`, kappa, nu]+Physics[Christoffel][`~kappa`, alpha, nu]*Physics[Christoffel][`~alpha`, mu, kappa]-D_[nu](Physics[Christoffel][`~alpha`, alpha, mu], [X])-Physics[Christoffel][`~lambda`, mu, nu]*Physics[Christoffel][`~alpha`, alpha, lambda]+Physics[Christoffel][`~beta`, mu, nu]*Physics[Christoffel][`~alpha`, alpha, beta]-Physics[Christoffel][`~beta`, alpha, mu]*Physics[Christoffel][`~alpha`, beta, nu])

    Physics:-Ricci[mu, nu] = Physics:-Christoffel[alpha, beta, mu]*Physics:-Christoffel[`~beta`, nu, `~alpha`]-Physics:-Christoffel[beta, mu, nu]*Physics:-Christoffel[alpha, `~alpha`, `~beta`]+Physics:-D_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-D_[nu](Physics:-Christoffel[alpha, mu, `~alpha`], [X])

    (34)

    C_to_Ricci := isolate(Physics[Ricci][mu, nu] = Physics[Christoffel][alpha, beta, mu]*Physics[Christoffel][`~beta`, nu, `~alpha`]-Physics[Christoffel][beta, mu, nu]*Physics[Christoffel][alpha, `~alpha`, `~beta`]+D_[alpha](Physics[Christoffel][`~alpha`, mu, nu], [X])-D_[nu](Physics[Christoffel][alpha, mu, `~alpha`], [X]), D_[alpha](Christoffel[`~alpha`, mu, nu]))

    Physics:-D_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X]) = -Physics:-Christoffel[alpha, beta, mu]*Physics:-Christoffel[`~beta`, nu, `~alpha`]+Physics:-Christoffel[beta, mu, nu]*Physics:-Christoffel[alpha, `~alpha`, `~beta`]+Physics:-Ricci[mu, nu]+Physics:-D_[nu](Physics:-Christoffel[alpha, mu, `~alpha`], [X])

    (35)

    Analogously, derive an expression to rewrite`&dtri;` derivatives of Christoffel symbols using the Riemann  tensor

    Riemann[`~alpha`, beta, mu, nu, definition]

    Physics:-Riemann[`~alpha`, beta, mu, nu] = Physics:-d_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])-Physics:-d_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])+Physics:-Christoffel[`~alpha`, upsilon, mu]*Physics:-Christoffel[`~upsilon`, beta, nu]-Physics:-Christoffel[`~alpha`, upsilon, nu]*Physics:-Christoffel[`~upsilon`, beta, mu]

    (36)

    convert(Physics[Riemann][`~alpha`, beta, mu, nu] = Physics[d_][mu](Physics[Christoffel][`~alpha`, beta, nu], [X])-Physics[d_][nu](Physics[Christoffel][`~alpha`, beta, mu], [X])+Physics[Christoffel][`~alpha`, upsilon, mu]*Physics[Christoffel][`~upsilon`, beta, nu]-Physics[Christoffel][`~alpha`, upsilon, nu]*Physics[Christoffel][`~upsilon`, beta, mu], D_)

    Physics:-Riemann[`~alpha`, beta, mu, nu] = Physics:-D_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])+Physics:-Christoffel[`~kappa`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, kappa]-Physics:-Christoffel[`~alpha`, kappa, mu]*Physics:-Christoffel[`~kappa`, beta, nu]+Physics:-Christoffel[`~kappa`, beta, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]-Physics:-D_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])-Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, lambda]-Physics:-Christoffel[`~lambda`, beta, nu]*Physics:-Christoffel[`~alpha`, lambda, mu]+Physics:-Christoffel[`~alpha`, lambda, nu]*Physics:-Christoffel[`~lambda`, beta, mu]+Physics:-Christoffel[`~alpha`, mu, upsilon]*Physics:-Christoffel[`~upsilon`, beta, nu]-Physics:-Christoffel[`~alpha`, nu, upsilon]*Physics:-Christoffel[`~upsilon`, beta, mu]

    (37)

    Simplify(Physics[Riemann][`~alpha`, beta, mu, nu] = D_[mu](Physics[Christoffel][`~alpha`, beta, nu], [X])+Physics[Christoffel][`~kappa`, mu, nu]*Physics[Christoffel][`~alpha`, beta, kappa]-Physics[Christoffel][`~alpha`, kappa, mu]*Physics[Christoffel][`~kappa`, beta, nu]+Physics[Christoffel][`~kappa`, beta, mu]*Physics[Christoffel][`~alpha`, kappa, nu]-D_[nu](Physics[Christoffel][`~alpha`, beta, mu], [X])-Physics[Christoffel][`~lambda`, mu, nu]*Physics[Christoffel][`~alpha`, beta, lambda]-Physics[Christoffel][`~lambda`, beta, nu]*Physics[Christoffel][`~alpha`, lambda, mu]+Physics[Christoffel][`~alpha`, lambda, nu]*Physics[Christoffel][`~lambda`, beta, mu]+Physics[Christoffel][`~alpha`, mu, upsilon]*Physics[Christoffel][`~upsilon`, beta, nu]-Physics[Christoffel][`~alpha`, nu, upsilon]*Physics[Christoffel][`~upsilon`, beta, mu])

    Physics:-Riemann[`~alpha`, beta, mu, nu] = -Physics:-Christoffel[`~alpha`, kappa, mu]*Physics:-Christoffel[`~kappa`, beta, nu]+Physics:-Christoffel[`~kappa`, beta, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]+Physics:-D_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])-Physics:-D_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])

    (38)

    C_to_Riemann := isolate(Physics[Riemann][`~alpha`, beta, mu, nu] = -Physics[Christoffel][`~alpha`, kappa, mu]*Physics[Christoffel][`~kappa`, beta, nu]+Physics[Christoffel][`~kappa`, beta, mu]*Physics[Christoffel][`~alpha`, kappa, nu]+D_[mu](Physics[Christoffel][`~alpha`, beta, nu], [X])-D_[nu](Physics[Christoffel][`~alpha`, beta, mu], [X]), D_[mu](Christoffel[`~alpha`, beta, nu]))

    Physics:-D_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X]) = Physics:-Christoffel[`~alpha`, kappa, mu]*Physics:-Christoffel[`~kappa`, beta, nu]-Physics:-Christoffel[`~kappa`, beta, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]+Physics:-Riemann[`~alpha`, beta, mu, nu]+Physics:-D_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])

    (39)

    Substitute  these two equations, in sequence, into Einstein's equations EEC≡(30)

    Substitute(C_to_Riemann, C_to_Ricci, EEC)

    -(1/4)*Physics:-Christoffel[`~beta`, psi, `~alpha`]*Physics:-Christoffel[`~psi`, omega, `~omega`]+(1/4)*Physics:-Christoffel[`~beta`, psi, `~omega`]*Physics:-Christoffel[`~psi`, omega, `~alpha`]+(1/4)*Physics:-Christoffel[`~alpha`, lambda, mu]*Physics:-Christoffel[`~lambda`, `~beta`, `~mu`]-(1/4)*Physics:-Christoffel[`~alpha`, lambda, `~mu`]*Physics:-Christoffel[`~lambda`, mu, `~beta`]+(1/4)*Physics:-Christoffel[`~beta`, nu, sigma]*Physics:-Christoffel[`~sigma`, `~alpha`, `~nu`]-(1/4)*Physics:-Christoffel[`~beta`, sigma, `~nu`]*Physics:-Christoffel[`~sigma`, nu, `~alpha`]+(1/2)*Physics:-Christoffel[omicron, zeta, `~beta`]*Physics:-Christoffel[`~zeta`, `~alpha`, `~omicron`]-(1/2)*Physics:-Christoffel[omicron, zeta, `~omicron`]*Physics:-Christoffel[`~zeta`, `~alpha`, `~beta`]-Physics:-Ricci[`~alpha`, `~beta`]-(1/2)*Physics:-Christoffel[`~tau`, `~alpha`, `~beta`]*Physics:-Christoffel[`~upsilon`, tau, upsilon]-(1/2)*Physics:-Christoffel[chi, iota, `~alpha`]*Physics:-Christoffel[`~iota`, `~beta`, `~chi`]+(1/4)*(Physics:-Christoffel[`~alpha`, chi, `~beta`]+Physics:-Christoffel[`~beta`, chi, `~alpha`])*Physics:-Christoffel[`~chi`, iota, `~iota`]+(1/2)*Physics:-Christoffel[`~upsilon`, tau, `~beta`]*Physics:-Christoffel[`~tau`, upsilon, `~alpha`]-(1/4)*Physics:-Christoffel[`~beta`, chi, iota]*Physics:-Christoffel[`~chi`, `~alpha`, `~iota`]+(1/2)*Physics:-Christoffel[chi, `~alpha`, `~beta`]*Physics:-Christoffel[iota, `~chi`, `~iota`]-(1/4)*Physics:-Christoffel[`~alpha`, chi, iota]*Physics:-Christoffel[`~chi`, `~beta`, `~iota`]-(1/4)*Physics:-D_[`~rho1`](Physics:-Christoffel[`~alpha`, rho1, `~beta`], [X])+(1/4)*Physics:-D_[`~mu`](Physics:-Christoffel[`~alpha`, mu, `~beta`], [X])+(1/4)*Physics:-D_[`~nu`](Physics:-Christoffel[`~beta`, nu, `~alpha`], [X])-(1/2)*Physics:-D_[`~beta`](Physics:-Christoffel[`~upsilon`, upsilon, `~alpha`], [X])-(1/4)*Physics:-D_[`~omega`](Physics:-Christoffel[`~beta`, omega, `~alpha`], [X])+(1/2)*Physics:-D_[`~beta`](Physics:-Christoffel[alpha9, `~alpha`, `~alpha9`], [X])-(1/4)*Physics:-Christoffel[`~alpha`, rho, `~beta`]*Physics:-Christoffel[`~rho`, rho1, `~rho1`]+(1/4)*Physics:-Christoffel[`~alpha`, rho, `~rho1`]*Physics:-Christoffel[`~rho`, rho1, `~beta`]+(1/2)*Physics:-Christoffel[alpha10, `~alpha`, `~beta`]*Physics:-Christoffel[alpha9, `~alpha10`, `~alpha9`]-(1/2)*Physics:-Christoffel[alpha9, alpha10, `~alpha`]*Physics:-Christoffel[`~alpha10`, `~alpha9`, `~beta`]+(1/4)*(2*Physics:-Christoffel[chi, iota, kappa]*Physics:-Christoffel[`~iota`, `~chi`, `~kappa`]-2*Physics:-Christoffel[chi, iota, `~chi`]*Physics:-Christoffel[`~iota`, kappa, `~kappa`]-2*Physics:-Christoffel[alpha4, alpha5, alpha6]*Physics:-Christoffel[`~alpha6`, `~alpha4`, `~alpha5`]+2*Physics:-Christoffel[alpha4, alpha6, `~alpha5`]*Physics:-Christoffel[`~alpha6`, alpha5, `~alpha4`]-2*Physics:-D_[`~alpha5`](Physics:-Christoffel[alpha4, alpha5, `~alpha4`], [X])+2*Physics:-Christoffel[`~alpha1`, alpha1, alpha3]*Physics:-Christoffel[`~alpha3`, alpha2, `~alpha2`]-2*Physics:-Christoffel[`~alpha1`, alpha3, `~alpha2`]*Physics:-Christoffel[`~alpha3`, alpha1, alpha2]+2*Physics:-Ricci[alpha2, `~alpha2`]+2*Physics:-D_[`~alpha2`](Physics:-Christoffel[`~alpha1`, alpha1, alpha2], [X]))*Physics:-g_[`~alpha`, `~beta`] = 0

    (40)

    Simplify  to arrive at the traditional compact form of Einstein's equations

    Simplify(-(1/4)*Physics[Christoffel][`~beta`, psi, `~alpha`]*Physics[Christoffel][`~psi`, omega, `~omega`]+(1/4)*Physics[Christoffel][`~beta`, psi, `~omega`]*Physics[Christoffel][`~psi`, omega, `~alpha`]+(1/4)*Physics[Christoffel][`~alpha`, lambda, mu]*Physics[Christoffel][`~lambda`, `~beta`, `~mu`]-(1/4)*Physics[Christoffel][`~alpha`, lambda, `~mu`]*Physics[Christoffel][`~lambda`, mu, `~beta`]+(1/4)*Physics[Christoffel][`~beta`, nu, sigma]*Physics[Christoffel][`~sigma`, `~alpha`, `~nu`]-(1/4)*Physics[Christoffel][`~beta`, sigma, `~nu`]*Physics[Christoffel][`~sigma`, nu, `~alpha`]+(1/2)*Physics[Christoffel][omicron, zeta, `~beta`]*Physics[Christoffel][`~zeta`, `~alpha`, `~omicron`]-(1/2)*Physics[Christoffel][omicron, zeta, `~omicron`]*Physics[Christoffel][`~zeta`, `~alpha`, `~beta`]-(1/2)*Physics[Christoffel][`~tau`, `~alpha`, `~beta`]*Physics[Christoffel][`~upsilon`, tau, upsilon]-(1/2)*Physics[Christoffel][chi, iota, `~alpha`]*Physics[Christoffel][`~iota`, `~beta`, `~chi`]+(1/4)*(Physics[Christoffel][`~alpha`, chi, `~beta`]+Physics[Christoffel][`~beta`, chi, `~alpha`])*Physics[Christoffel][`~chi`, iota, `~iota`]+(1/2)*Physics[Christoffel][`~upsilon`, tau, `~beta`]*Physics[Christoffel][`~tau`, upsilon, `~alpha`]-(1/4)*Physics[Christoffel][`~beta`, chi, iota]*Physics[Christoffel][`~chi`, `~alpha`, `~iota`]+(1/2)*Physics[Christoffel][chi, `~alpha`, `~beta`]*Physics[Christoffel][iota, `~chi`, `~iota`]-(1/4)*Physics[Christoffel][`~alpha`, chi, iota]*Physics[Christoffel][`~chi`, `~beta`, `~iota`]-(1/4)*Physics[Christoffel][`~alpha`, rho, `~beta`]*Physics[Christoffel][`~rho`, rho1, `~rho1`]+(1/4)*Physics[Christoffel][`~alpha`, rho, `~rho1`]*Physics[Christoffel][`~rho`, rho1, `~beta`]+(1/2)*Physics[Christoffel][alpha10, `~alpha`, `~beta`]*Physics[Christoffel][alpha9, `~alpha10`, `~alpha9`]-(1/2)*Physics[Christoffel][alpha9, alpha10, `~alpha`]*Physics[Christoffel][`~alpha10`, `~alpha9`, `~beta`]+(1/4)*(2*Physics[Christoffel][chi, iota, kappa]*Physics[Christoffel][`~iota`, `~chi`, `~kappa`]-2*Physics[Christoffel][chi, iota, `~chi`]*Physics[Christoffel][`~iota`, kappa, `~kappa`]-2*Physics[Christoffel][alpha4, alpha5, alpha6]*Physics[Christoffel][`~alpha6`, `~alpha4`, `~alpha5`]+2*Physics[Christoffel][alpha4, alpha6, `~alpha5`]*Physics[Christoffel][`~alpha6`, alpha5, `~alpha4`]-2*D_[`~alpha5`](Physics[Christoffel][alpha4, alpha5, `~alpha4`], [X])+2*Physics[Christoffel][`~alpha1`, alpha1, alpha3]*Physics[Christoffel][`~alpha3`, alpha2, `~alpha2`]-2*Physics[Christoffel][`~alpha1`, alpha3, `~alpha2`]*Physics[Christoffel][`~alpha3`, alpha1, alpha2]+2*Physics[Ricci][alpha2, `~alpha2`]+2*D_[`~alpha2`](Physics[Christoffel][`~alpha1`, alpha1, alpha2], [X]))*Physics[g_][`~alpha`, `~beta`]-(1/4)*D_[`~rho1`](Physics[Christoffel][`~alpha`, rho1, `~beta`], [X])+(1/4)*D_[`~mu`](Physics[Christoffel][`~alpha`, mu, `~beta`], [X])+(1/4)*D_[`~nu`](Physics[Christoffel][`~beta`, nu, `~alpha`], [X])-(1/2)*D_[`~beta`](Physics[Christoffel][`~upsilon`, upsilon, `~alpha`], [X])-(1/4)*D_[`~omega`](Physics[Christoffel][`~beta`, omega, `~alpha`], [X])+(1/2)*D_[`~beta`](Physics[Christoffel][alpha9, `~alpha`, `~alpha9`], [X])-Physics[Ricci][`~alpha`, `~beta`] = 0)

    (1/2)*Physics:-Ricci[chi, `~chi`]*Physics:-g_[`~alpha`, `~beta`]-Physics:-Ricci[`~alpha`, `~beta`] = 0

    (41)

     

    Linearized Gravity

     

     

    Generally speaking, linearizing gravity is about discarding in Einstein's field equations the terms that are quadratic in the metric and its derivatives, an approximation valid when the gravitational field is weak (the deviation from a flat Minkowski spacetime is small). Linearizing gravity is used, e.g. in the study of gravitational waves. In the context of Maple's Physics , the formulation of linearized gravity can be done using the general relativity tensors that come predefined in Physics plus a new in Maple 2025 Physics:-Library:-Linearize  command.

     

    In what follows it is shown how to linearize the Ricci  tensor and through it Einstein 's equations. To compare results, see for instance the Wikipedia page for Linearized gravity. Start setting coordinates, you could use Cartesian, spherical, cylindrical, or define your own.

    restart; with(Physics); Setup(coordinates = cartesian)

    `Systems of spacetime coordinates are:`*{X = (x, y, z, t)}

     

    _______________________________________________________

     

    [coordinatesystems = {X}]

    (42)

    The default metric when Physics is loaded is the Minkowski metric, representing a flat (no curvature) spacetime

    g_[]

    Physics:-g_[mu, nu] = Matrix(%id = 36893488151987392132)

    (43)

    The weakly perturbed metric


    Suppose you want to define a small perturbation around this metric. For that purpose, define a perturbation tensor h[mu, nu], that in the general case depends on the coordinates and is not diagonal, the only requirement is that it is symmetric (to have it diagonal, change symmetric by diagonal; to have it constant, change delta[i, j](X) by delta[i, j])

    h[mu, nu] = Matrix(4, proc (i, j) options operator, arrow; delta[i, j](X) end proc, shape = symmetric)

    h[mu, nu] = Matrix(%id = 36893488152568729716)

    (44)

    In the above it is understood that `&ll;`(`&delta;__i,j`, 1), so that quadratic or higher powers of it or its derivatives can be approximated to 0 (discarded). Define the components of `h__&mu;,&nu;` accordingly

    "Define(?)"

    `Defined objects with tensor properties`

     

    {Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (45)

    Define also a tensor `&eta;__&mu;,&nu;` representing the unperturbed Minkowski metric

    "eta[mu,nu] = rhs(?)"

    eta[mu, nu] = Matrix(%id = 36893488151987392132)

    (46)

    "Define(?)"

    `Defined objects with tensor properties`

     

    {Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (47)

    The weakly perturbed metric is given by

    g_[mu, nu] = eta[mu, nu]+h[mu, nu]

    Physics:-g_[mu, nu] = eta[mu, nu]+h[mu, nu]

    (48)

    Make this be the definition of the metric

    Define(Physics[g_][mu, nu] = eta[mu, nu]+h[mu, nu])

    _______________________________________________________

     

    `Coordinates: `[x, y, z, t]*`. Signature: `(`- - - +`)

     

    _______________________________________________________

     

    Physics:-g_[mu, nu] = Matrix(%id = 36893488152066920564)

     

    _______________________________________________________

     

    `Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

     

    `Defined objects with tensor properties`

     

    {Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], h[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (49)

     

    Linearizing the Ricci tensor


    The linearized form of the Ricci  tensor is computed by introducing this weakly perturbed metric (48) in the expression of the Ricci tensor as a function of the metric. This can be accomplished in different ways, the simpler being to use the conversion network between tensors , but for illustration purposes, showing steps one at time, a substitution of definitions one into the other one is used

    Ricci[definition]

    Physics:-Ricci[mu, nu] = Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-d_[nu](Physics:-Christoffel[`~alpha`, mu, alpha], [X])+Physics:-Christoffel[`~beta`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, alpha]-Physics:-Christoffel[`~beta`, mu, alpha]*Physics:-Christoffel[`~alpha`, nu, beta]

    (50)

    Christoffel[`~alpha`, mu, nu, definition]

    Physics:-Christoffel[`~alpha`, mu, nu] = (1/2)*Physics:-g_[`~alpha`, `~beta`]*(Physics:-d_[nu](Physics:-g_[beta, mu], [X])+Physics:-d_[mu](Physics:-g_[beta, nu], [X])-Physics:-d_[beta](Physics:-g_[mu, nu], [X]))

    (51)

    Substitute(Physics[Christoffel][`~alpha`, mu, nu] = (1/2)*Physics[g_][`~alpha`, `~beta`]*(Physics[d_][nu](Physics[g_][beta, mu], [X])+Physics[d_][mu](Physics[g_][beta, nu], [X])-Physics[d_][beta](Physics[g_][mu, nu], [X])), Physics[Ricci][mu, nu] = Physics[d_][alpha](Physics[Christoffel][`~alpha`, mu, nu], [X])-Physics[d_][nu](Physics[Christoffel][`~alpha`, mu, alpha], [X])+Physics[Christoffel][`~beta`, mu, nu]*Physics[Christoffel][`~alpha`, beta, alpha]-Physics[Christoffel][`~beta`, mu, alpha]*Physics[Christoffel][`~alpha`, nu, beta])

    Physics:-Ricci[mu, nu] = Physics:-d_[alpha]((1/2)*Physics:-g_[`~alpha`, `~kappa`]*(Physics:-d_[nu](Physics:-g_[kappa, mu], [X])+Physics:-d_[mu](Physics:-g_[kappa, nu], [X])-Physics:-d_[kappa](Physics:-g_[mu, nu], [X])), [X])-Physics:-d_[nu]((1/2)*Physics:-g_[`~alpha`, `~tau`]*(Physics:-d_[mu](Physics:-g_[tau, alpha], [X])+Physics:-d_[alpha](Physics:-g_[tau, mu], [X])-Physics:-d_[tau](Physics:-g_[alpha, mu], [X])), [X])+(1/4)*Physics:-g_[`~beta`, `~iota`]*(Physics:-d_[nu](Physics:-g_[iota, mu], [X])+Physics:-d_[mu](Physics:-g_[iota, nu], [X])-Physics:-d_[iota](Physics:-g_[mu, nu], [X]))*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[beta](Physics:-g_[lambda, alpha], [X])+Physics:-d_[alpha](Physics:-g_[lambda, beta], [X])-Physics:-d_[lambda](Physics:-g_[alpha, beta], [X]))-(1/4)*Physics:-g_[`~beta`, `~omega`]*(Physics:-d_[mu](Physics:-g_[omega, alpha], [X])+Physics:-d_[alpha](Physics:-g_[omega, mu], [X])-Physics:-d_[omega](Physics:-g_[alpha, mu], [X]))*Physics:-g_[`~alpha`, `~chi`]*(Physics:-d_[nu](Physics:-g_[chi, beta], [X])+Physics:-d_[beta](Physics:-g_[chi, nu], [X])-Physics:-d_[chi](Physics:-g_[beta, nu], [X]))

    (52)

    Introducing (48)g[mu, nu] = eta[mu, nu]+h[mu, nu], and also the inert form of the Ricci tensor to facilitate simplification some steps below,

    Substitute(Physics[g_][mu, nu] = eta[mu, nu]+h[mu, nu], Ricci = %Ricci, Physics[Ricci][mu, nu] = Physics[d_][alpha]((1/2)*Physics[g_][`~alpha`, `~kappa`]*(Physics[d_][nu](Physics[g_][kappa, mu], [X])+Physics[d_][mu](Physics[g_][kappa, nu], [X])-Physics[d_][kappa](Physics[g_][mu, nu], [X])), [X])-Physics[d_][nu]((1/2)*Physics[g_][`~alpha`, `~tau`]*(Physics[d_][mu](Physics[g_][tau, alpha], [X])+Physics[d_][alpha](Physics[g_][tau, mu], [X])-Physics[d_][tau](Physics[g_][alpha, mu], [X])), [X])+(1/4)*Physics[g_][`~beta`, `~iota`]*(Physics[d_][nu](Physics[g_][iota, mu], [X])+Physics[d_][mu](Physics[g_][iota, nu], [X])-Physics[d_][iota](Physics[g_][mu, nu], [X]))*Physics[g_][`~alpha`, `~lambda`]*(Physics[d_][beta](Physics[g_][lambda, alpha], [X])+Physics[d_][alpha](Physics[g_][lambda, beta], [X])-Physics[d_][lambda](Physics[g_][alpha, beta], [X]))-(1/4)*Physics[g_][`~beta`, `~omega`]*(Physics[d_][mu](Physics[g_][omega, alpha], [X])+Physics[d_][alpha](Physics[g_][omega, mu], [X])-Physics[d_][omega](Physics[g_][alpha, mu], [X]))*Physics[g_][`~alpha`, `~chi`]*(Physics[d_][nu](Physics[g_][chi, beta], [X])+Physics[d_][beta](Physics[g_][chi, nu], [X])-Physics[d_][chi](Physics[g_][beta, nu], [X])))

    %Ricci[mu, nu] = (1/2)*Physics:-d_[alpha](eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`], [X])*(Physics:-d_[nu](eta[kappa, mu]+h[kappa, mu], [X])+Physics:-d_[mu](eta[kappa, nu]+h[kappa, nu], [X])-Physics:-d_[kappa](eta[mu, nu]+h[mu, nu], [X]))+(1/2)*(eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`])*(Physics:-d_[alpha](Physics:-d_[nu](eta[kappa, mu]+h[kappa, mu], [X]), [X])+Physics:-d_[alpha](Physics:-d_[mu](eta[kappa, nu]+h[kappa, nu], [X]), [X])-Physics:-d_[alpha](Physics:-d_[kappa](eta[mu, nu]+h[mu, nu], [X]), [X]))-(1/2)*Physics:-d_[nu](eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`], [X])*(Physics:-d_[mu](eta[alpha, tau]+h[alpha, tau], [X])+Physics:-d_[alpha](eta[mu, tau]+h[mu, tau], [X])-Physics:-d_[tau](eta[alpha, mu]+h[alpha, mu], [X]))-(1/2)*(eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`])*(Physics:-d_[mu](Physics:-d_[nu](eta[alpha, tau]+h[alpha, tau], [X]), [X])+Physics:-d_[alpha](Physics:-d_[nu](eta[mu, tau]+h[mu, tau], [X]), [X])-Physics:-d_[nu](Physics:-d_[tau](eta[alpha, mu]+h[alpha, mu], [X]), [X]))+(1/4)*(eta[`~beta`, `~iota`]+h[`~beta`, `~iota`])*(Physics:-d_[nu](eta[iota, mu]+h[iota, mu], [X])+Physics:-d_[mu](eta[iota, nu]+h[iota, nu], [X])-Physics:-d_[iota](eta[mu, nu]+h[mu, nu], [X]))*(eta[`~alpha`, `~lambda`]+h[`~alpha`, `~lambda`])*(Physics:-d_[beta](eta[alpha, lambda]+h[alpha, lambda], [X])+Physics:-d_[alpha](eta[beta, lambda]+h[beta, lambda], [X])-Physics:-d_[lambda](eta[alpha, beta]+h[alpha, beta], [X]))-(1/4)*(eta[`~beta`, `~omega`]+h[`~beta`, `~omega`])*(Physics:-d_[mu](eta[alpha, omega]+h[alpha, omega], [X])+Physics:-d_[alpha](eta[mu, omega]+h[mu, omega], [X])-Physics:-d_[omega](eta[alpha, mu]+h[alpha, mu], [X]))*(eta[`~alpha`, `~chi`]+h[`~alpha`, `~chi`])*(Physics:-d_[nu](eta[beta, chi]+h[beta, chi], [X])+Physics:-d_[beta](eta[chi, nu]+h[chi, nu], [X])-Physics:-d_[chi](eta[beta, nu]+h[beta, nu], [X]))

    (53)

    This expression contains several terms quadratic in the small perturbation `h__&mu;,&nu;` and its derivatives. The new in Maple 2025 routine to filter out those terms is Physics:-Library:-Linearize , which requires specifying the symbol representing the small quantities

    Library:-Linearize(%Ricci[mu, nu] = (1/2)*Physics[d_][alpha](eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`], [X])*(Physics[d_][nu](eta[kappa, mu]+h[kappa, mu], [X])+Physics[d_][mu](eta[kappa, nu]+h[kappa, nu], [X])-Physics[d_][kappa](eta[mu, nu]+h[mu, nu], [X]))+(1/2)*(eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`])*(Physics[d_][alpha](Physics[d_][nu](eta[kappa, mu]+h[kappa, mu], [X]), [X])+Physics[d_][alpha](Physics[d_][mu](eta[kappa, nu]+h[kappa, nu], [X]), [X])-Physics[d_][alpha](Physics[d_][kappa](eta[mu, nu]+h[mu, nu], [X]), [X]))-(1/2)*Physics[d_][nu](eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`], [X])*(Physics[d_][mu](eta[alpha, tau]+h[alpha, tau], [X])+Physics[d_][alpha](eta[mu, tau]+h[mu, tau], [X])-Physics[d_][tau](eta[alpha, mu]+h[alpha, mu], [X]))-(1/2)*(eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`])*(Physics[d_][mu](Physics[d_][nu](eta[alpha, tau]+h[alpha, tau], [X]), [X])+Physics[d_][alpha](Physics[d_][nu](eta[mu, tau]+h[mu, tau], [X]), [X])-Physics[d_][nu](Physics[d_][tau](eta[alpha, mu]+h[alpha, mu], [X]), [X]))+(1/4)*(eta[`~beta`, `~iota`]+h[`~beta`, `~iota`])*(Physics[d_][nu](eta[iota, mu]+h[iota, mu], [X])+Physics[d_][mu](eta[iota, nu]+h[iota, nu], [X])-Physics[d_][iota](eta[mu, nu]+h[mu, nu], [X]))*(eta[`~alpha`, `~lambda`]+h[`~alpha`, `~lambda`])*(Physics[d_][beta](eta[alpha, lambda]+h[alpha, lambda], [X])+Physics[d_][alpha](eta[beta, lambda]+h[beta, lambda], [X])-Physics[d_][lambda](eta[alpha, beta]+h[alpha, beta], [X]))-(1/4)*(eta[`~beta`, `~omega`]+h[`~beta`, `~omega`])*(Physics[d_][mu](eta[alpha, omega]+h[alpha, omega], [X])+Physics[d_][alpha](eta[mu, omega]+h[mu, omega], [X])-Physics[d_][omega](eta[alpha, mu]+h[alpha, mu], [X]))*(eta[`~alpha`, `~chi`]+h[`~alpha`, `~chi`])*(Physics[d_][nu](eta[beta, chi]+h[beta, chi], [X])+Physics[d_][beta](eta[chi, nu]+h[chi, nu], [X])-Physics[d_][chi](eta[beta, nu]+h[beta, nu], [X])), h)

    %Ricci[mu, nu] = (1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[nu](Physics:-d_[tau](h[alpha, mu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[mu](Physics:-d_[nu](h[alpha, tau], [X]), [X])-(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[kappa](h[mu, nu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[nu](h[kappa, mu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[mu](h[kappa, nu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[alpha](Physics:-d_[nu](h[mu, tau], [X]), [X])

    (54)

    Important: in this result, `&eta;__&mu;,&nu;` is the flat Minkowski metric, not the perturbed metric g[mu, nu]. However, in the context of a linearized formulation, `&eta;__&mu;,&nu;` raises and lowers tensor indices the same way as g[mu, nu]. Hence, to further simplify contracted products of eta[mu, nu] in (54) , it is practical to reintroduce `g__&mu;,&nu;`representing that Minkowski metric and simplify using the internal algorithms for a flat metric

    g_[min]

    _______________________________________________________

     

    `The Minkowski metric in coordinates `*[x, y, z, t]

     

    `Signature: `(`- - - +`)

     

    _______________________________________________________

     

    Physics:-g_[mu, nu] = Matrix(%id = 36893488152066895868)

    (55)

    To proceed simplifying, replace in the expression (54) for the Ricci tensor the intermediate Minkowski `&eta;__&mu;,&nu;`by `#msub(mi("g"),mrow(mi("&mu;",fontstyle = "normal"),mo("&comma;"),mi("&nu;",fontstyle = "normal")))`

    subs(eta = g_, %Ricci[mu, nu] = (1/2)*eta[`~alpha`, `~tau`]*Physics[d_][nu](Physics[d_][tau](h[alpha, mu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics[d_][mu](Physics[d_][nu](h[alpha, tau], [X]), [X])-(1/2)*eta[`~alpha`, `~kappa`]*Physics[d_][alpha](Physics[d_][kappa](h[mu, nu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics[d_][alpha](Physics[d_][nu](h[kappa, mu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics[d_][alpha](Physics[d_][mu](h[kappa, nu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics[d_][alpha](Physics[d_][nu](h[mu, tau], [X]), [X]))

    %Ricci[mu, nu] = (1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[nu](Physics:-d_[tau](h[alpha, mu], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[mu](Physics:-d_[nu](h[alpha, tau], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[kappa](h[mu, nu], [X]), [X])+(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[nu](h[kappa, mu], [X]), [X])+(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[mu](h[kappa, nu], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[alpha](Physics:-d_[nu](h[mu, tau], [X]), [X])

    (56)

    Simplifying, results in the linearized form of the Ricci tensor shown in the Wikipedia page for Linearized gravity.

    Simplify(%Ricci[mu, nu] = (1/2)*Physics[g_][`~alpha`, `~tau`]*Physics[d_][nu](Physics[d_][tau](h[alpha, mu], [X]), [X])-(1/2)*Physics[g_][`~alpha`, `~tau`]*Physics[d_][mu](Physics[d_][nu](h[alpha, tau], [X]), [X])-(1/2)*Physics[g_][`~alpha`, `~kappa`]*Physics[d_][alpha](Physics[d_][kappa](h[mu, nu], [X]), [X])+(1/2)*Physics[g_][`~alpha`, `~kappa`]*Physics[d_][alpha](Physics[d_][nu](h[kappa, mu], [X]), [X])+(1/2)*Physics[g_][`~alpha`, `~kappa`]*Physics[d_][alpha](Physics[d_][mu](h[kappa, nu], [X]), [X])-(1/2)*Physics[g_][`~alpha`, `~tau`]*Physics[d_][alpha](Physics[d_][nu](h[mu, tau], [X]), [X]))

    %Ricci[mu, nu] = -(1/2)*Physics:-d_[mu](Physics:-d_[nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics:-dAlembertian(h[mu, nu], [X])+(1/2)*Physics:-d_[nu](Physics:-d_[tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics:-d_[mu](Physics:-d_[tau](h[nu, `~tau`], [X]), [X])

    (57)

    Linearizing Einstein's equations

    Einstein's equations are the components of Einstein's tensor , whose definition in terms of the Ricci tensor is

    Einstein[definition]

    Physics:-Einstein[mu, nu] = Physics:-Ricci[mu, nu]-(1/2)*Physics:-g_[mu, nu]*Physics:-Ricci[alpha, `~alpha`]

    (58)

    Compute the trace R[alpha, `~alpha`] directly from the linearized form (57) of the Ricci tensor,

    g_[mu, nu]*(%Ricci[mu, nu] = -(1/2)*Physics[d_][mu](Physics[d_][nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics[dAlembertian](h[mu, nu], [X])+(1/2)*Physics[d_][nu](Physics[d_][tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics[d_][mu](Physics[d_][tau](h[nu, `~tau`], [X]), [X]))

    %Ricci[mu, nu]*Physics:-g_[`~mu`, `~nu`] = (-(1/2)*Physics:-d_[mu](Physics:-d_[nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics:-dAlembertian(h[mu, nu], [X])+(1/2)*Physics:-d_[nu](Physics:-d_[tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics:-d_[mu](Physics:-d_[tau](h[nu, `~tau`], [X]), [X]))*Physics:-g_[`~mu`, `~nu`]

    (59)

    Simplify(%Ricci[mu, nu]*Physics[g_][`~mu`, `~nu`] = (-(1/2)*Physics[d_][mu](Physics[d_][nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics[dAlembertian](h[mu, nu], [X])+(1/2)*Physics[d_][nu](Physics[d_][tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics[d_][mu](Physics[d_][tau](h[nu, `~tau`], [X]), [X]))*Physics[g_][`~mu`, `~nu`])

    %Ricci[nu, `~nu`] = -Physics:-dAlembertian(h[alpha, `~alpha`], [X])+Physics:-d_[alpha](Physics:-d_[tau](h[`~alpha`, `~tau`], [X]), [X])

    (60)

    The linearized Einstein equations are constructed reproducing the definition (58) using (57) and (60)

    (%Ricci[mu, nu] = -(1/2)*Physics[d_][mu](Physics[d_][nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics[dAlembertian](h[mu, nu], [X])+(1/2)*Physics[d_][nu](Physics[d_][tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics[d_][mu](Physics[d_][tau](h[nu, `~tau`], [X]), [X]))-(1/2)*g_[mu, nu]*(%Ricci[nu, `~nu`] = -Physics[dAlembertian](h[alpha, `~alpha`], [X])+Physics[d_][alpha](Physics[d_][tau](h[`~alpha`, `~tau`], [X]), [X]))

    %Ricci[mu, nu]-(1/2)*Physics:-g_[mu, nu]*%Ricci[alpha, `~alpha`] = -(1/2)*Physics:-d_[mu](Physics:-d_[nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics:-dAlembertian(h[mu, nu], [X])+(1/2)*Physics:-d_[nu](Physics:-d_[tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics:-d_[mu](Physics:-d_[tau](h[nu, `~tau`], [X]), [X])-(1/2)*Physics:-g_[mu, nu]*(-Physics:-dAlembertian(h[alpha, `~alpha`], [X])+Physics:-d_[alpha](Physics:-d_[tau](h[`~alpha`, `~tau`], [X]), [X]))

    (61)

    which is the same formula shown in the Wikipedia page for Linearized gravity.


    You can now redefine the general h[mu, nu] introduced in (44) in different ways (see discussion in the Wikipedia page), or, depending on the case, just substitute your preferred gauge in this formula (61) for the general case. For example, the condition for the Harmonic gauge also known as Lorentz gauge reduces the linearized field equations to their simplest form

    d_[mu](h[`~mu`, nu]) = (1/2)*d_[nu](h[alpha, alpha])

    Physics:-d_[mu](h[`~mu`, nu], [X]) = (1/2)*Physics:-d_[nu](h[alpha, `~alpha`], [X])

    (62)

    Substitute(Physics[d_][mu](h[`~mu`, nu], [X]) = (1/2)*Physics[d_][nu](h[alpha, `~alpha`], [X]), %Ricci[mu, nu]-(1/2)*Physics[g_][mu, nu]*%Ricci[alpha, `~alpha`] = -(1/2)*Physics[d_][mu](Physics[d_][nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics[dAlembertian](h[mu, nu], [X])+(1/2)*Physics[d_][nu](Physics[d_][tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics[d_][mu](Physics[d_][tau](h[nu, `~tau`], [X]), [X])-(1/2)*Physics[g_][mu, nu]*(-Physics[dAlembertian](h[alpha, `~alpha`], [X])+Physics[d_][alpha](Physics[d_][tau](h[`~alpha`, `~tau`], [X]), [X])))

    %Ricci[mu, nu]-(1/2)*Physics:-g_[mu, nu]*%Ricci[alpha, `~alpha`] = -(1/2)*Physics:-d_[mu](Physics:-d_[nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics:-dAlembertian(h[mu, nu], [X])+(1/2)*Physics:-d_[nu]((1/2)*Physics:-d_[mu](h[lambda, `~lambda`], [X]), [X])+(1/2)*Physics:-d_[mu]((1/2)*Physics:-d_[nu](h[kappa, `~kappa`], [X]), [X])-(1/2)*Physics:-g_[mu, nu]*(-Physics:-dAlembertian(h[alpha, `~alpha`], [X])+Physics:-d_[alpha]((1/2)*Physics:-d_[`~alpha`](h[beta, `~beta`], [X]), [X]))

    (63)

    Simplify(%Ricci[mu, nu]-(1/2)*Physics[g_][mu, nu]*%Ricci[alpha, `~alpha`] = -(1/2)*Physics[d_][mu](Physics[d_][nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics[dAlembertian](h[mu, nu], [X])+(1/2)*Physics[d_][nu]((1/2)*Physics[d_][mu](h[lambda, `~lambda`], [X]), [X])+(1/2)*Physics[d_][mu]((1/2)*Physics[d_][nu](h[kappa, `~kappa`], [X]), [X])-(1/2)*Physics[g_][mu, nu]*(-Physics[dAlembertian](h[alpha, `~alpha`], [X])+Physics[d_][alpha]((1/2)*Physics[d_][`~alpha`](h[beta, `~beta`], [X]), [X])))

    %Ricci[mu, nu]-(1/2)*Physics:-g_[mu, nu]*%Ricci[alpha, `~alpha`] = -(1/2)*Physics:-dAlembertian(h[mu, nu], [X])+(1/4)*Physics:-dAlembertian(h[alpha, `~alpha`], [X])*Physics:-g_[mu, nu]

    (64)

    Relative Tensors

     

     

    In General Relativity, the context of a curved spacetime, it is sometimes necessary to work with relative tensors, for which the transformation rule under a transformation of coordinates involves powers of the determinant of the transformation - see Chapter 4 of  "Lovelock, D., and Rund, H. Tensors, Differential Forms and Variational Principles, Dover, 1989." Physics  in Maple 2025 includes a complete, new implementation of relative tensors.

     

    To indicate that a tensor being defined is relative pass its relative weight. For example, set a curved spacetime,

    restart; with(Physics); g_[sc]

    _______________________________________________________

     

    `Systems of spacetime coordinates are:`*{X = (r, theta, phi, t)}

     

    `Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (r, theta, phi, t)}

     

    `Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

     

    `The Schwarzschild metric in coordinates `*[r, theta, phi, t]

     

    `Parameters: `[m]

     

    `Signature: `(`- - - +`)

     

    _______________________________________________________

     

    Physics:-g_[mu, nu] = Matrix(%id = 36893488152573138332)

    (65)

    Define now two tensors of one index, one of them being relative

    Define(T[mu])

    `Defined objects with tensor properties`

     

    {Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], T[mu], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (66)

    Define(R[mu], relativeweight = 1)

    `Defined objects with tensor properties`

     

    {Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], R[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], T[mu], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (67)

    Transformation of Coordinates

     

    Consider a transformation of coordinates, from spherical r, theta, phi, t to  rho, theta, phi, t where

    TR := r = (1+m/(2*rho))^2*rho

    r = (1+(1/2)*m/rho)^2*rho

    (68)

    The transformed components of T[mu] and R[mu] are, respectively,

    TransformCoordinates(TR, T[mu], [rho, theta, phi, t])

    Vector[column](%id = 36893488151820263660)

    (69)

    TransformCoordinates(TR, R[mu], [rho, theta, phi, t])

    Vector[column](%id = 36893488151823155676)

    (70)

    where, when comparing both results, we see that the transformed components for R[mu] are all multiplied by J^n with n = 1 and J is the determinant of the transformation:

    J__matrix := simplify(VectorCalculus:-Jacobian([rhs(TR), theta, phi, t], [rho, theta, phi, t]))

    Matrix(%id = 36893488151964220700)

    (71)

    J = LinearAlgebra:-Determinant(J__matrix)

    J = (1/4)*(-m^2+4*rho^2)/rho^2

    (72)

    Relative weight

     

    The relative weight of a scalar, tensor or tensorial expression can be computed using the Physics:-Library:-GetRelativeWeight  command. For the two tensors T[mu] and R[mu] used above,

    Library:-GetRelativeWeight(T[mu])

    0

    (73)

    Library:-GetRelativeWeight(R[mu])

    1

    (74)

    The relative weight of a tensor does not depend on the covariant or contravariant character of its indices

    Library:-GetRelativeWeight(R[`~mu`])

    1

    (75)

    The LeviCivita  tensor is a special case, has its relative weight defined when Physics  is loaded, and because in a curved spacetime it is not a tensor its relative weight depends on the covariant or contravariant character of its indices

    Library:-GetRelativeWeight(LeviCivita[alpha, beta, mu, nu])

    -1

    (76)

    "Library:-GetRelativeWeight(LeviCivita[~alpha, ~beta, ~mu,~nu])   "

    1

    (77)

    The relative weight w of a product is equal to the sum of relative weights of each factor

    R[mu]^2

    R[mu]*R[`~mu`]

    (78)

    Library:-GetRelativeWeight(R[mu]*R[`~mu`])

    2

    (79)

    The relative weight w of a power is equal to the relative weight of the base multiplied by the power

    1/R[mu]^2

    1/(R[mu]*R[`~mu`])

    (80)

    Library:-GetRelativeWeight(1/(R[mu]*R[`~mu`]))

    -2

    (81)

    The relative weight w of a sum is equal to the relative weight of one of its terms and exists if all the terms have the same w.

    "R[~mu] + LeviCivita[~alpha, ~beta, ~mu,~nu]*T[alpha] T[beta] T[nu]"

    T[alpha]*T[beta]*T[nu]*Physics:-LeviCivita[`~alpha`, `~beta`, `~mu`, `~nu`]+R[`~mu`]

    (82)

    Library:-GetRelativeWeight(T[alpha]*T[beta]*T[nu]*Physics[LeviCivita][`~alpha`, `~beta`, `~mu`, `~nu`]+R[`~mu`])

    1

    (83)

    The relative weight of any determinant is always equal to 2

    %g_[determinant]

    %g_[determinant]

    (84)

    Library:-GetRelativeWeight(%g_[determinant])

    2

    (85)

    Relative Term in covariant derivatives

     

    When computing the covariant derivative of a relative scalar, tensor or tensorial expression that has non-zero relative weight w, a relative term is added, that can be computed using the Physics:-Library:-GetRelativeWeight  command.

    g__det := %g_[:-determinant]

    %g_[determinant]

    (86)

    Library:-GetRelativeTerm(g__det, mu)

    -2*Physics:-Christoffel[`~nu`, mu, nu]*%g_[determinant]

    (87)
      

    Consequently,

    (%D_[mu] = D_[mu])(g__det)

    %D_[mu](%g_[determinant]) = 0

    (88)
      

    To understand this zero value on the right-hand side, express the left-hand side in terms of d_

    convert(%D_[mu](%g_[determinant]) = 0, d_)

    %d_[mu](%g_[determinant], [X])-2*Physics:-Christoffel[`~alpha`, alpha, mu]*%g_[determinant] = 0

    (89)
      

    evaluate the inert %d_

    factor(eval(%d_[mu](%g_[determinant], [X])-2*Physics[Christoffel][`~alpha`, alpha, mu]*%g_[determinant] = 0, %d_ = d_))

    %g_[determinant]*(Physics:-g_[`~alpha`, `~nu`]*Physics:-d_[mu](Physics:-g_[alpha, nu], [X])-2*Physics:-Christoffel[`~alpha`, alpha, mu]) = 0

    (90)
      

    The factor in parentheses is equal to `#mrow(msubsup(mi("g"),none(),mrow(mi("&alpha;",fontstyle = "normal"),mo("&comma;"),mi("&nu;",fontstyle = "normal"))),msub(mi("&dtri;"),mi("&mu;",fontstyle = "normal")),mo("&ApplyFunction;"),mfenced(msub(mi("g"),mrow(mi("&alpha;",fontstyle = "normal"),mo("&comma;"),mi("&nu;",fontstyle = "normal")))))`, where the covariant derivative of the metric is equal to zero, so

    Simplify(%g_[determinant]*(Physics[g_][`~alpha`, `~nu`]*Physics[d_][mu](Physics[g_][alpha, nu], [X])-2*Physics[Christoffel][`~alpha`, alpha, mu]) = 0)

    0 = 0

    (91)
      

    Consider the covariant derivative of T[mu] and R[mu] defined in (66) and (67)

    Library:-GetRelativeWeight(T[mu])

    0

    (92)

    Library:-GetRelativeWeight(R[mu])

    1

    (93)

    The corresponding covariant derivatives

    (%D_[mu] = D_[mu])(T[mu](X))

    %D_[mu](T[`~mu`](X)) = Physics:-D_[mu](T[`~mu`](X), [X])

    (94)

    expand(%D_[mu](T[`~mu`](X)) = D_[mu](T[`~mu`](X), [X]))

    %D_[mu](T[`~mu`](X)) = 2*T[`~mu`](X)*Physics:-d_[mu](r, [X])/r+Physics:-d_[mu](theta, [X])*cos(theta)*T[`~mu`](X)/sin(theta)+Physics:-d_[mu](T[`~mu`](X), [X])

    (95)

    (%D_[mu] = D_[mu])(R[mu](X))

    %D_[mu](R[`~mu`](X)) = Physics:-D_[mu](R[`~mu`](X), [X])

    (96)

    expand(%D_[mu](R[`~mu`](X)) = D_[mu](R[`~mu`](X), [X]))

    %D_[mu](R[`~mu`](X)) = 2*R[`~mu`](X)*Physics:-d_[mu](r, [X])/r+Physics:-d_[mu](theta, [X])*cos(theta)*R[`~mu`](X)/sin(theta)+Physics:-d_[mu](R[`~mu`](X), [X])-Physics:-Christoffel[`~nu`, mu, nu]*R[`~mu`](X)

    (97)

    where in the above we see the additional (relative) term

    Library:-GetRelativeTerm(R[`~mu`](X), mu)

    -Physics:-Christoffel[`~nu`, mu, nu]*R[`~mu`](X)

    (98)

     

    New Physics:-Library commands

     

     

    ConvertToF , Linearize , GetRelativeTerm , GetRelativeWeight.

     

    Examples

     

    • 

    ConvertToF receives an algebraic expression involving tensors and/or tensor functions and rewrites them in terms of the tensor of name F when that is possible. This routine is similar, however more general than the standard convert  which only handles the existing conversion network for the tensors of General Relativity  in that ConvertToF also uses any tensor definition you introduce using Define , expressing a tensor in terms of others.

    Load any curved spacetime metric automatically setting the coordinates

     

    restart; with(Physics); g_[sc]

    Physics:-g_[mu, nu] = Matrix(%id = 36893488152573203868)

    (99)

     

    For example, rewrite the Christoffel  symbols in terms of the metric g_ ; this works as in previous releases

    Christoffel[mu, alpha, beta] = Library:-ConvertToF(Christoffel[mu, alpha, beta], g_)

    Physics:-Christoffel[mu, alpha, beta] = (1/2)*Physics:-d_[beta](Physics:-g_[alpha, mu], [X])+(1/2)*Physics:-d_[alpha](Physics:-g_[beta, mu], [X])-(1/2)*Physics:-d_[mu](Physics:-g_[alpha, beta], [X])

    (100)

    Define a A[mu] representing the 4D electromagnetic potential as a function of the coordinates X and F[mu, nu] representing the electromagnetic field tensors

    Define(A[mu] = A[mu](X), quiet)

    {A[mu], Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (101)

    Define(F[mu, nu] = d_[mu](A[nu])-d_[nu](A[mu]))

    `Defined objects with tensor properties`

     

    {A[mu], Physics:-D_[mu], Physics:-Dgamma[mu], F[mu, nu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

    (102)

    Rewrite the following expression in terms of the electromagnetic potential A[mu]

    F[mu, nu] = Library:-ConvertToF(F[mu, nu], A)

    F[mu, nu] = Physics:-d_[mu](A[nu], [X])-Physics:-d_[nu](A[mu], [X])

    (103)

    In the example above, the output is similar to this other one

    F[definition]

    F[mu, nu] = Physics:-d_[mu](A[nu], [X])-Physics:-d_[nu](A[mu], [X])

    (104)

    The rewriting, however, works also with tensorial expressions

    F[mu, nu]*A[mu]*A[nu]

    F[mu, nu]*A[`~mu`]*A[`~nu`]

    (105)

    Library:-ConvertToF(F[mu, nu]*A[`~mu`]*A[`~nu`], A)

    (Physics:-d_[mu](A[nu], [X])-Physics:-d_[nu](A[mu], [X]))*A[`~mu`]*A[`~nu`]

    (106)
    • 

    Linearize receives a tensorial expression T and an indication of the small quantities h in T , and discards terms quadratic or of higher order in h. For an example of this new routine in action, see the section Linearized Gravity  above.

    • 

    GetRelativeTerm and GetRelativeWeight are illustrated in the section Relative Tensors  above.

     

    See Also

     

    Index of New Maple 2025 Features , Physics , Computer Algebra for Theoretical Physics, The Physics project, The Physics Updates

    NULL


     

    Download New_in_Physics_2025.mw

    Edgardo S. Cheb-Terrab
    Physics, Differential Equations and Mathematical Functions

    Computing Einstein's equations using variational principles

    Edgardo S. Cheb-Terrab

    Freddy Baudine

     

    One of the biggest challenges for a computer algebra system is to compute Einstein's equations from first principles, by equating to zero the functional derivative of the Action for gravity, without using human-shortcuts or tricks. Developments during 2024, appearing as new in Maple 2025, broke through that barrier and now the LagrangeEquations  Physics command, introduced in 2023, can perform that elusive computation of Einstein's equations, not using tabulated cases, properly handling several (traditional or not) alternative ways of presenting the Lagrangian (the integrand in the Action), taking advantage of the functional differentiation  capabilities of the Physics  package .

     

    The computation can be performed in one call to Physics:-LagrangeEquations, or in steps interactively using the Physics:-Fundiff  and Physics:-Simplify  commands that include newly implemented capabilities for simplifying tensorial expressions in curved spacetimes. This is an exciting breakthrough/milestone in Computer Algebra, also in an area out of reach of neural network AIs.

     

    Einstein's equations are a system of second order nonlinear coupled partial differential equations for the 10 components of the spacetime metric g[mu, nu]

    with(Physics); Setup(coordinates = cartesian, metric = arbitrary)

    `Systems of spacetime coordinates are:`*{X = (x, y, z, t)}

     

    _______________________________________________________

     

    `Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

     

    `The arbitrary metric in coordinates `*[x, y, z, t]

     

    `Signature: `(`- - - +`)

     

    _______________________________________________________

     

    Physics:-g_[mu, nu] = Matrix(%id = 36893488152225885228)

     

    _______________________________________________________; "_noterminate"

    (1)

    In the Lagrangian formulation, the coordinates of the problem are the 10 components of the metric,

    CompactDisplay(g_[])

    f__1(x, y, z, t)*`will now be displayed as`*f__1

     

    f__10(x, y, z, t)*`will now be displayed as`*f__10

     

    f__2(x, y, z, t)*`will now be displayed as`*f__2

     

    f__3(x, y, z, t)*`will now be displayed as`*f__3

     

    f__4(x, y, z, t)*`will now be displayed as`*f__4

     

    f__5(x, y, z, t)*`will now be displayed as`*f__5

     

    f__6(x, y, z, t)*`will now be displayed as`*f__6

     

    f__7(x, y, z, t)*`will now be displayed as`*f__7

     

    f__8(x, y, z, t)*`will now be displayed as`*f__8

     

    f__9(x, y, z, t)*`will now be displayed as`*f__9

    (2)

    and the parameters of the variational problem are the spacetime coordinates X^alpha.

     

    The traditional Lagrangian

     

    The simplest case is that of Einstein's equation in vacuum, for which the Lagrangian density is expressed in terms of the trace of the Ricci  tensor and the determinant of the metric by

    L := sqrt(-%g_[determinant])*Ricci[alpha, `~alpha`]

    (-%g_[determinant])^(1/2)*Physics:-Ricci[alpha, `~alpha`]

    (3)

    What was almost a dream in previous years, Einstein's equations can now be computed in one simple instruction as the Lagrange equations for this Lagrangian, in the traditional compact form, taking the components of the metric tensor as the coordinates (for an interactive, step by step computation, see further below)

    LagrangeEquations(L, g_[mu, nu])

    -(1/2)*Physics:-g_[mu, nu]*Physics:-Ricci[alpha, `~alpha`]+Physics:-Ricci[mu, nu] = 0

    (4)

    The tensorial equation computed is also the definition of the Einstein  tensor

    Einstein[definition]

    Physics:-Einstein[mu, nu] = -(1/2)*Physics:-g_[mu, nu]*Physics:-Ricci[alpha, `~alpha`]+Physics:-Ricci[mu, nu]

    (5)

    A Lagrangian depending only on first derivatives of the metric

     

    The Lagrangian L used to compute Einstein's equations (4)  contains first and second derivatives of the metric; the latter make the computation significantly more complicated. The second order derivatives, however, can be removed from the formulation. To see that, rewrite L in terms of Christoffel  symbols

    L__C := convert(L, Christoffel)

    (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda])

    (6)

    Recalling the definition

    Christoffel[definition]

    Physics:-Christoffel[alpha, mu, nu] = (1/2)*Physics:-d_[nu](Physics:-g_[alpha, mu], [X])+(1/2)*Physics:-d_[mu](Physics:-g_[alpha, nu], [X])-(1/2)*Physics:-d_[alpha](Physics:-g_[mu, nu], [X])

    (7)

    in L[C] the two terms containing derivatives of Christoffel symbols contain second order derivatives of g[mu, nu].

     

    Now, it is always possible to add a total spacetime derivative to L[C] without changing Einstein's equations (assuming the variation of the metric in the corresponding boundary integrals vanishes), and in that way, in this particular case of L[C], obtain a Lagrangian involving only 1st order derivatives. The total derivative, expressed using the inert `&PartialD;` command to see it before the differentiation operation is performed, is

    TD := %d_[alpha](g_[`~mu`, `~nu`]*sqrt(-%g_[determinant])*(g_[`~alpha`, mu]*Christoffel[`~beta`, nu, beta]-Christoffel[`~alpha`, mu, nu]))

    %d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu]))

    (8)

    Adding this term to L[C], performing the `&PartialD;` differentiation operation and simplifying we get

    L__1 := L__C+TD

    (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda])+%d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu]))

    (9)

    L__1 := eval(L__1, %d_ = d_)

    (-%g_[determinant])^(1/2)*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])-Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])+Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]-Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda])+Physics:-d_[alpha](Physics:-g_[`~mu`, `~nu`], [X])*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])-(1/2)*Physics:-g_[`~mu`, `~nu`]*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])*%g_[determinant]*Physics:-g_[`~kappa`, `~lambda`]*Physics:-d_[alpha](Physics:-g_[kappa, lambda], [X])/(-%g_[determinant])^(1/2)+Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-d_[alpha](Physics:-Christoffel[`~beta`, beta, nu], [X])-Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X]))

    (10)

    L__1 := Simplify(L__1)

    (Physics:-Christoffel[alpha, beta, kappa]*Physics:-Christoffel[`~beta`, `~alpha`, `~kappa`]-Physics:-Christoffel[alpha, beta, `~alpha`]*Physics:-Christoffel[`~beta`, kappa, `~kappa`])*(-%g_[determinant])^(1/2)

    (11)

    which is a Lagrangian depending only on 1st order derivatives of the metric through Christoffel  symbols. As expected, the equations of motion resulting from this Lagrangian are the same Einstein equations computed in (4); this computation can also now be performed in a single call

    LagrangeEquations(L__1, g_[mu, nu])

    -(1/2)*Physics:-Ricci[iota, `~iota`]*Physics:-g_[mu, nu]+Physics:-Ricci[mu, nu] = 0

    (12)

    Simplification capabilities developed to cover these computations

     

    To illustrate the new Maple 2025 tensorial simplification capabilities note that `&equiv;`(L[1], (Physics[Christoffel][alpha, beta, kappa]*Physics[Christoffel][`~beta`, `~alpha`, `~kappa`]-Physics[Christoffel][alpha, beta, `~alpha`]*Physics[Christoffel][`~beta`, kappa, `~kappa`])*(-%g_[determinant])^(1/2)) is no just L[C] ≡ (6) after discarding its two terms involving derivatives of Christoffel symbols. To verify this, split L[C] into the terms containing or not derivatives of Christoffel

    L__22, L__11 := selectremove(has, expand(L__C), d_)

    (-%g_[determinant])^(1/2)*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])*Physics:-g_[`~alpha`, `~lambda`]-(-%g_[determinant])^(1/2)*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])*Physics:-g_[`~alpha`, `~lambda`], (-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]*Physics:-g_[`~alpha`, `~lambda`]-(-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]*Physics:-g_[`~alpha`, `~lambda`]

    (13)

    Comparing, the total derivative TD≡ (8) is not just -L[22], but

    TD = -L__22-2*L__11

    %d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])) = -(-%g_[determinant])^(1/2)*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])*Physics:-g_[`~alpha`, `~lambda`]+(-%g_[determinant])^(1/2)*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])*Physics:-g_[`~alpha`, `~lambda`]-2*(-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]*Physics:-g_[`~alpha`, `~lambda`]+2*(-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]*Physics:-g_[`~alpha`, `~lambda`]

    (14)

    Things like these, TD = -L__22-2*L__11, can now be verified directly with the new tensorial simplification capabilities: take the left-hand side minus the right-hand side, evaluate the inert derivative `&PartialD;` and simplify to see the equality is true

    (lhs-rhs)(%d_[alpha](Physics[g_][`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu])) = -(-%g_[determinant])^(1/2)*Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])*Physics[g_][`~alpha`, `~lambda`]+(-%g_[determinant])^(1/2)*Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])*Physics[g_][`~alpha`, `~lambda`]-2*(-%g_[determinant])^(1/2)*Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]*Physics[g_][`~alpha`, `~lambda`]+2*(-%g_[determinant])^(1/2)*Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda]*Physics[g_][`~alpha`, `~lambda`])

    %d_[alpha](Physics:-g_[`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu]))+(-%g_[determinant])^(1/2)*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])*Physics:-g_[`~alpha`, `~lambda`]-(-%g_[determinant])^(1/2)*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])*Physics:-g_[`~alpha`, `~lambda`]+2*(-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]*Physics:-g_[`~alpha`, `~lambda`]-2*(-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]*Physics:-g_[`~alpha`, `~lambda`]

    (15)

    eval(%d_[alpha](Physics[g_][`~mu`, `~nu`]*(-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu]))+(-%g_[determinant])^(1/2)*Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])*Physics[g_][`~alpha`, `~lambda`]-(-%g_[determinant])^(1/2)*Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])*Physics[g_][`~alpha`, `~lambda`]+2*(-%g_[determinant])^(1/2)*Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]*Physics[g_][`~alpha`, `~lambda`]-2*(-%g_[determinant])^(1/2)*Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda]*Physics[g_][`~alpha`, `~lambda`], %d_ = d_)

    (-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])*Physics:-d_[alpha](Physics:-g_[`~mu`, `~nu`], [X])-(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-Christoffel[`~beta`, beta, nu]-Physics:-Christoffel[`~alpha`, mu, nu])*Physics:-g_[`~mu`, `~nu`]*%g_[determinant]*Physics:-g_[`~kappa`, `~lambda`]*Physics:-d_[alpha](Physics:-g_[kappa, lambda], [X])/(-%g_[determinant])^(1/2)+(-%g_[determinant])^(1/2)*(Physics:-g_[mu, `~alpha`]*Physics:-d_[alpha](Physics:-Christoffel[`~beta`, beta, nu], [X])-Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X]))*Physics:-g_[`~mu`, `~nu`]+(-%g_[determinant])^(1/2)*Physics:-d_[nu](Physics:-Christoffel[`~nu`, alpha, lambda], [X])*Physics:-g_[`~alpha`, `~lambda`]-(-%g_[determinant])^(1/2)*Physics:-d_[lambda](Physics:-Christoffel[`~nu`, alpha, nu], [X])*Physics:-g_[`~alpha`, `~lambda`]+2*(-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, lambda]*Physics:-Christoffel[`~nu`, beta, nu]*Physics:-g_[`~alpha`, `~lambda`]-2*(-%g_[determinant])^(1/2)*Physics:-Christoffel[`~beta`, alpha, nu]*Physics:-Christoffel[`~nu`, beta, lambda]*Physics:-g_[`~alpha`, `~lambda`]

    (16)

    Simplify((-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu])*Physics[d_][alpha](Physics[g_][`~mu`, `~nu`], [X])-(1/2)*(Physics[g_][mu, `~alpha`]*Physics[Christoffel][`~beta`, beta, nu]-Physics[Christoffel][`~alpha`, mu, nu])*Physics[g_][`~mu`, `~nu`]*%g_[determinant]*Physics[g_][`~kappa`, `~lambda`]*Physics[d_][alpha](Physics[g_][kappa, lambda], [X])/(-%g_[determinant])^(1/2)+(-%g_[determinant])^(1/2)*(Physics[g_][mu, `~alpha`]*Physics[d_][alpha](Physics[Christoffel][`~beta`, beta, nu], [X])-Physics[d_][alpha](Physics[Christoffel][`~alpha`, mu, nu], [X]))*Physics[g_][`~mu`, `~nu`]+(-%g_[determinant])^(1/2)*Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])*Physics[g_][`~alpha`, `~lambda`]-(-%g_[determinant])^(1/2)*Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])*Physics[g_][`~alpha`, `~lambda`]+2*(-%g_[determinant])^(1/2)*Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]*Physics[g_][`~alpha`, `~lambda`]-2*(-%g_[determinant])^(1/2)*Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda]*Physics[g_][`~alpha`, `~lambda`])

    0

    (17)

    That said, it is also true that TD = -L[22]-2*L[11] results in the Lagrangian L[1] = -L[11], and since the equations of movement don't depend on the sign of the Lagrangian, for this Lagrangian `&equiv;`(L[C], (-%g_[determinant])^(1/2)*Physics[g_][`~alpha`, `~lambda`]*(Physics[d_][nu](Physics[Christoffel][`~nu`, alpha, lambda], [X])-Physics[d_][lambda](Physics[Christoffel][`~nu`, alpha, nu], [X])+Physics[Christoffel][`~beta`, alpha, lambda]*Physics[Christoffel][`~nu`, beta, nu]-Physics[Christoffel][`~beta`, alpha, nu]*Physics[Christoffel][`~nu`, beta, lambda])) adding the term TD happens to be equivalent to just discarding the terms of L__C involving derivatives of Christoffel symbols.

     

    Derivation step by step using functional differentiation (variational principle)

     

    Also new in Maple 2025, due to the extension of Fundiff  to compute in curved spacetimes, it is now possible to compute Einstein's equations from first principles by constructing the action,

    S := Intc(L, X)

    Int(Int(Int(Int((-%g_[determinant])^(1/2)*Physics:-Ricci[alpha, `~alpha`], x = -infinity .. infinity), y = -infinity .. infinity), z = -infinity .. infinity), t = -infinity .. infinity)

    (18)

    and equating to zero the functional derivative with respect to the metric. To avoid displaying the resulting large expression, end the input line with ":"

    EE__unsimplified := Fundiff(S, g_[alpha, beta]) = 0

    Simplifying this result, we get an expression in terms of Christoffel  symbols and its derivatives

    EEC := Simplify(EE__unsimplified)

    (1/4)*(2*Physics:-Christoffel[chi, iota, kappa]*Physics:-Christoffel[`~iota`, `~chi`, `~kappa`]-2*Physics:-Christoffel[chi, iota, `~chi`]*Physics:-Christoffel[`~iota`, kappa, `~kappa`]-2*Physics:-D_[iota](Physics:-Christoffel[chi, `~chi`, `~iota`], [X])+2*Physics:-D_[chi](Physics:-Christoffel[`~chi`, iota, `~iota`], [X]))*Physics:-g_[`~alpha`, `~beta`]+(1/4)*(Physics:-Christoffel[`~alpha`, chi, `~beta`]+Physics:-Christoffel[`~beta`, chi, `~alpha`])*Physics:-Christoffel[`~chi`, iota, `~iota`]-(1/4)*Physics:-Christoffel[`~beta`, chi, iota]*Physics:-Christoffel[`~chi`, `~alpha`, `~iota`]-(1/2)*Physics:-Christoffel[chi, iota, `~alpha`]*Physics:-Christoffel[`~iota`, `~beta`, `~chi`]+(1/2)*Physics:-Christoffel[chi, `~alpha`, `~beta`]*Physics:-Christoffel[iota, `~chi`, `~iota`]-(1/4)*Physics:-Christoffel[`~alpha`, chi, iota]*Physics:-Christoffel[`~chi`, `~beta`, `~iota`]+(1/4)*Physics:-D_[chi](Physics:-Christoffel[`~alpha`, `~beta`, `~chi`], [X])+(1/4)*Physics:-D_[chi](Physics:-Christoffel[`~beta`, `~alpha`, `~chi`], [X])-(1/2)*Physics:-D_[chi](Physics:-Christoffel[`~chi`, `~alpha`, `~beta`], [X])-(1/4)*Physics:-D_[`~alpha`](Physics:-Christoffel[`~beta`, chi, `~chi`], [X])+(1/2)*Physics:-D_[`~beta`](Physics:-Christoffel[chi, `~alpha`, `~chi`], [X])-(1/4)*Physics:-D_[`~beta`](Physics:-Christoffel[`~alpha`, chi, `~chi`], [X]) = 0

    (19)

    In this result, we see`&dtri;` derivatives of Christoffel  symbols, expressed using the D_  command for covariant differentiation. Although, such objects have not the geometrical meaning of a covariant derivative, computationally, they here represent what would be a covariant derivative if the Christoffel symbols were a tensor. For example,

    "`&dtri;`[chi](GAMMA[]^(alpha,beta,chi)) :"

    % = expand(%)

    Physics:-D_[chi](Physics:-Christoffel[`~alpha`, `~beta`, `~chi`], [X]) = Physics:-d_[chi](Physics:-Christoffel[`~alpha`, `~beta`, `~chi`], [X])+Physics:-Christoffel[`~alpha`, chi, mu]*Physics:-Christoffel[`~mu`, `~beta`, `~chi`]+Physics:-Christoffel[`~beta`, chi, mu]*Physics:-Christoffel[`~alpha`, `~chi`, `~mu`]+Physics:-Christoffel[`~chi`, chi, mu]*Physics:-Christoffel[`~alpha`, `~beta`, `~mu`]

    (20)

    With this computational meaning for the`&dtri;` derivatives of Christoffel symbols appearing in (19), rewrite EEC(19) in terms of the Ricci  and Riemann  tensors. For that, consider the definition

    Ricci[definition]

    Physics:-Ricci[mu, nu] = Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-d_[nu](Physics:-Christoffel[`~alpha`, mu, alpha], [X])+Physics:-Christoffel[`~beta`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, alpha]-Physics:-Christoffel[`~beta`, mu, alpha]*Physics:-Christoffel[`~alpha`, nu, beta]

    (21)

    Rewrite the noncovariant derivatives `&PartialD;` in terms of`&dtri;` derivatives using the computational representation (20), simplify and isolate one of them

    convert(Physics[Ricci][mu, nu] = Physics[d_][alpha](Physics[Christoffel][`~alpha`, mu, nu], [X])-Physics[d_][nu](Physics[Christoffel][`~alpha`, mu, alpha], [X])+Physics[Christoffel][`~beta`, mu, nu]*Physics[Christoffel][`~alpha`, beta, alpha]-Physics[Christoffel][`~beta`, mu, alpha]*Physics[Christoffel][`~alpha`, nu, beta], D_)

    Physics:-Ricci[mu, nu] = Physics:-D_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-Christoffel[`~alpha`, alpha, kappa]*Physics:-Christoffel[`~kappa`, mu, nu]+Physics:-Christoffel[`~kappa`, alpha, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]+Physics:-Christoffel[`~kappa`, alpha, nu]*Physics:-Christoffel[`~alpha`, mu, kappa]-Physics:-D_[nu](Physics:-Christoffel[`~alpha`, alpha, mu], [X])-Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~alpha`, alpha, lambda]+Physics:-Christoffel[`~beta`, mu, nu]*Physics:-Christoffel[`~alpha`, alpha, beta]-Physics:-Christoffel[`~beta`, alpha, mu]*Physics:-Christoffel[`~alpha`, beta, nu]

    (22)

    Simplify(Physics[Ricci][mu, nu] = D_[alpha](Physics[Christoffel][`~alpha`, mu, nu], [X])-Physics[Christoffel][`~alpha`, alpha, kappa]*Physics[Christoffel][`~kappa`, mu, nu]+Physics[Christoffel][`~kappa`, alpha, mu]*Physics[Christoffel][`~alpha`, kappa, nu]+Physics[Christoffel][`~kappa`, alpha, nu]*Physics[Christoffel][`~alpha`, mu, kappa]-D_[nu](Physics[Christoffel][`~alpha`, alpha, mu], [X])-Physics[Christoffel][`~lambda`, mu, nu]*Physics[Christoffel][`~alpha`, alpha, lambda]+Physics[Christoffel][`~beta`, mu, nu]*Physics[Christoffel][`~alpha`, alpha, beta]-Physics[Christoffel][`~beta`, alpha, mu]*Physics[Christoffel][`~alpha`, beta, nu])

    Physics:-Ricci[mu, nu] = Physics:-Christoffel[alpha, beta, mu]*Physics:-Christoffel[`~beta`, nu, `~alpha`]-Physics:-Christoffel[beta, mu, nu]*Physics:-Christoffel[alpha, `~alpha`, `~beta`]+Physics:-D_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-D_[nu](Physics:-Christoffel[alpha, mu, `~alpha`], [X])

    (23)

    C_to_Ricci := isolate(Physics[Ricci][mu, nu] = Physics[Christoffel][alpha, beta, mu]*Physics[Christoffel][`~beta`, nu, `~alpha`]-Physics[Christoffel][beta, mu, nu]*Physics[Christoffel][alpha, `~alpha`, `~beta`]+D_[alpha](Physics[Christoffel][`~alpha`, mu, nu], [X])-D_[nu](Physics[Christoffel][alpha, mu, `~alpha`], [X]), D_[alpha](Christoffel[`~alpha`, mu, nu]))

    Physics:-D_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X]) = -Physics:-Christoffel[alpha, beta, mu]*Physics:-Christoffel[`~beta`, nu, `~alpha`]+Physics:-Christoffel[beta, mu, nu]*Physics:-Christoffel[alpha, `~alpha`, `~beta`]+Physics:-Ricci[mu, nu]+Physics:-D_[nu](Physics:-Christoffel[alpha, mu, `~alpha`], [X])

    (24)

    Analogously, derive an expression to rewrite`&dtri;` derivatives of Christoffel symbols using the Riemann  tensor

    Riemann[`~alpha`, beta, mu, nu, definition]

    Physics:-Riemann[`~alpha`, beta, mu, nu] = Physics:-d_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])-Physics:-d_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])+Physics:-Christoffel[`~alpha`, upsilon, mu]*Physics:-Christoffel[`~upsilon`, beta, nu]-Physics:-Christoffel[`~alpha`, upsilon, nu]*Physics:-Christoffel[`~upsilon`, beta, mu]

    (25)

    convert(Physics[Riemann][`~alpha`, beta, mu, nu] = Physics[d_][mu](Physics[Christoffel][`~alpha`, beta, nu], [X])-Physics[d_][nu](Physics[Christoffel][`~alpha`, beta, mu], [X])+Physics[Christoffel][`~alpha`, upsilon, mu]*Physics[Christoffel][`~upsilon`, beta, nu]-Physics[Christoffel][`~alpha`, upsilon, nu]*Physics[Christoffel][`~upsilon`, beta, mu], D_)

    Physics:-Riemann[`~alpha`, beta, mu, nu] = Physics:-D_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])+Physics:-Christoffel[`~kappa`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, kappa]-Physics:-Christoffel[`~alpha`, kappa, mu]*Physics:-Christoffel[`~kappa`, beta, nu]+Physics:-Christoffel[`~kappa`, beta, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]-Physics:-D_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])-Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, lambda]-Physics:-Christoffel[`~lambda`, beta, nu]*Physics:-Christoffel[`~alpha`, lambda, mu]+Physics:-Christoffel[`~alpha`, lambda, nu]*Physics:-Christoffel[`~lambda`, beta, mu]+Physics:-Christoffel[`~alpha`, mu, upsilon]*Physics:-Christoffel[`~upsilon`, beta, nu]-Physics:-Christoffel[`~alpha`, nu, upsilon]*Physics:-Christoffel[`~upsilon`, beta, mu]

    (26)

    Simplify(Physics[Riemann][`~alpha`, beta, mu, nu] = D_[mu](Physics[Christoffel][`~alpha`, beta, nu], [X])+Physics[Christoffel][`~kappa`, mu, nu]*Physics[Christoffel][`~alpha`, beta, kappa]-Physics[Christoffel][`~alpha`, kappa, mu]*Physics[Christoffel][`~kappa`, beta, nu]+Physics[Christoffel][`~kappa`, beta, mu]*Physics[Christoffel][`~alpha`, kappa, nu]-D_[nu](Physics[Christoffel][`~alpha`, beta, mu], [X])-Physics[Christoffel][`~lambda`, mu, nu]*Physics[Christoffel][`~alpha`, beta, lambda]-Physics[Christoffel][`~lambda`, beta, nu]*Physics[Christoffel][`~alpha`, lambda, mu]+Physics[Christoffel][`~alpha`, lambda, nu]*Physics[Christoffel][`~lambda`, beta, mu]+Physics[Christoffel][`~alpha`, mu, upsilon]*Physics[Christoffel][`~upsilon`, beta, nu]-Physics[Christoffel][`~alpha`, nu, upsilon]*Physics[Christoffel][`~upsilon`, beta, mu])

    Physics:-Riemann[`~alpha`, beta, mu, nu] = -Physics:-Christoffel[`~alpha`, kappa, mu]*Physics:-Christoffel[`~kappa`, beta, nu]+Physics:-Christoffel[`~kappa`, beta, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]+Physics:-D_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])-Physics:-D_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])

    (27)

    C_to_Riemann := isolate(Physics[Riemann][`~alpha`, beta, mu, nu] = -Physics[Christoffel][`~alpha`, kappa, mu]*Physics[Christoffel][`~kappa`, beta, nu]+Physics[Christoffel][`~kappa`, beta, mu]*Physics[Christoffel][`~alpha`, kappa, nu]+D_[mu](Physics[Christoffel][`~alpha`, beta, nu], [X])-D_[nu](Physics[Christoffel][`~alpha`, beta, mu], [X]), D_[mu](Christoffel[`~alpha`, beta, nu]))

    Physics:-D_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X]) = Physics:-Christoffel[`~alpha`, kappa, mu]*Physics:-Christoffel[`~kappa`, beta, nu]-Physics:-Christoffel[`~kappa`, beta, mu]*Physics:-Christoffel[`~alpha`, kappa, nu]+Physics:-Riemann[`~alpha`, beta, mu, nu]+Physics:-D_[nu](Physics:-Christoffel[`~alpha`, beta, mu], [X])

    (28)

    Substitute  these two equations, in sequence, into Einstein's equations EEC≡(19)

    Substitute(C_to_Riemann, C_to_Ricci, EEC)

    (1/4)*(2*Physics:-Christoffel[chi, iota, kappa]*Physics:-Christoffel[`~iota`, `~chi`, `~kappa`]-2*Physics:-Christoffel[chi, iota, `~chi`]*Physics:-Christoffel[`~iota`, kappa, `~kappa`]-2*Physics:-Christoffel[alpha4, alpha5, alpha6]*Physics:-Christoffel[`~alpha6`, `~alpha4`, `~alpha5`]+2*Physics:-Christoffel[alpha4, alpha6, `~alpha5`]*Physics:-Christoffel[`~alpha6`, alpha5, `~alpha4`]-2*Physics:-D_[`~alpha5`](Physics:-Christoffel[alpha4, alpha5, `~alpha4`], [X])+2*Physics:-Christoffel[`~alpha1`, alpha1, alpha3]*Physics:-Christoffel[`~alpha3`, alpha2, `~alpha2`]-2*Physics:-Christoffel[`~alpha1`, alpha3, `~alpha2`]*Physics:-Christoffel[`~alpha3`, alpha1, alpha2]+2*Physics:-Ricci[alpha2, `~alpha2`]+2*Physics:-D_[`~alpha2`](Physics:-Christoffel[`~alpha1`, alpha1, alpha2], [X]))*Physics:-g_[`~alpha`, `~beta`]-Physics:-Ricci[`~alpha`, `~beta`]+(1/2)*Physics:-Christoffel[alpha10, `~alpha`, `~beta`]*Physics:-Christoffel[alpha9, `~alpha10`, `~alpha9`]-(1/2)*Physics:-Christoffel[alpha9, alpha10, `~alpha`]*Physics:-Christoffel[`~alpha10`, `~alpha9`, `~beta`]-(1/4)*Physics:-Christoffel[`~alpha`, chi, iota]*Physics:-Christoffel[`~chi`, `~beta`, `~iota`]-(1/4)*Physics:-Christoffel[`~beta`, chi, iota]*Physics:-Christoffel[`~chi`, `~alpha`, `~iota`]+(1/2)*Physics:-Christoffel[chi, `~alpha`, `~beta`]*Physics:-Christoffel[iota, `~chi`, `~iota`]+(1/4)*(Physics:-Christoffel[`~alpha`, chi, `~beta`]+Physics:-Christoffel[`~beta`, chi, `~alpha`])*Physics:-Christoffel[`~chi`, iota, `~iota`]-(1/2)*Physics:-Christoffel[chi, iota, `~alpha`]*Physics:-Christoffel[`~iota`, `~beta`, `~chi`]-(1/4)*Physics:-Christoffel[`~alpha`, rho, `~beta`]*Physics:-Christoffel[`~rho`, rho1, `~rho1`]+(1/4)*Physics:-Christoffel[`~alpha`, rho, `~rho1`]*Physics:-Christoffel[`~rho`, rho1, `~beta`]-(1/2)*Physics:-Christoffel[omicron, zeta, `~omicron`]*Physics:-Christoffel[`~zeta`, `~alpha`, `~beta`]+(1/2)*Physics:-Christoffel[omicron, zeta, `~beta`]*Physics:-Christoffel[`~zeta`, `~alpha`, `~omicron`]-(1/4)*Physics:-Christoffel[`~beta`, psi, `~alpha`]*Physics:-Christoffel[`~psi`, omega, `~omega`]+(1/4)*Physics:-Christoffel[`~beta`, psi, `~omega`]*Physics:-Christoffel[`~psi`, omega, `~alpha`]+(1/2)*Physics:-Christoffel[`~tau`, upsilon, `~alpha`]*Physics:-Christoffel[`~upsilon`, tau, `~beta`]-(1/2)*Physics:-Christoffel[`~tau`, `~alpha`, `~beta`]*Physics:-Christoffel[`~upsilon`, tau, upsilon]+(1/4)*Physics:-Christoffel[`~beta`, nu, sigma]*Physics:-Christoffel[`~sigma`, `~alpha`, `~nu`]-(1/4)*Physics:-Christoffel[`~beta`, sigma, `~nu`]*Physics:-Christoffel[`~sigma`, nu, `~alpha`]-(1/4)*Physics:-Christoffel[`~alpha`, lambda, `~mu`]*Physics:-Christoffel[`~lambda`, mu, `~beta`]+(1/4)*Physics:-Christoffel[`~alpha`, lambda, mu]*Physics:-Christoffel[`~lambda`, `~beta`, `~mu`]-(1/2)*Physics:-D_[`~beta`](Physics:-Christoffel[`~upsilon`, upsilon, `~alpha`], [X])+(1/4)*Physics:-D_[`~nu`](Physics:-Christoffel[`~beta`, nu, `~alpha`], [X])+(1/4)*Physics:-D_[`~mu`](Physics:-Christoffel[`~alpha`, mu, `~beta`], [X])-(1/4)*Physics:-D_[`~omega`](Physics:-Christoffel[`~beta`, omega, `~alpha`], [X])+(1/2)*Physics:-D_[`~beta`](Physics:-Christoffel[alpha9, `~alpha`, `~alpha9`], [X])-(1/4)*Physics:-D_[`~rho1`](Physics:-Christoffel[`~alpha`, rho1, `~beta`], [X]) = 0

    (29)

    Simplify  to arrive at the traditional compact form of Einstein's equations

    Simplify(-(1/2)*D_[`~beta`](Physics[Christoffel][`~upsilon`, upsilon, `~alpha`], [X])+(1/4)*D_[`~nu`](Physics[Christoffel][`~beta`, nu, `~alpha`], [X])+(1/4)*D_[`~mu`](Physics[Christoffel][`~alpha`, mu, `~beta`], [X])-(1/4)*D_[`~omega`](Physics[Christoffel][`~beta`, omega, `~alpha`], [X])+(1/2)*D_[`~beta`](Physics[Christoffel][alpha9, `~alpha`, `~alpha9`], [X])-(1/4)*D_[`~rho1`](Physics[Christoffel][`~alpha`, rho1, `~beta`], [X])-Physics[Ricci][`~alpha`, `~beta`]-(1/2)*Physics[Christoffel][alpha9, alpha10, `~alpha`]*Physics[Christoffel][`~alpha10`, `~alpha9`, `~beta`]-(1/4)*Physics[Christoffel][`~alpha`, chi, iota]*Physics[Christoffel][`~chi`, `~beta`, `~iota`]-(1/4)*Physics[Christoffel][`~beta`, chi, iota]*Physics[Christoffel][`~chi`, `~alpha`, `~iota`]+(1/2)*Physics[Christoffel][chi, `~alpha`, `~beta`]*Physics[Christoffel][iota, `~chi`, `~iota`]+(1/4)*(Physics[Christoffel][`~alpha`, chi, `~beta`]+Physics[Christoffel][`~beta`, chi, `~alpha`])*Physics[Christoffel][`~chi`, iota, `~iota`]-(1/2)*Physics[Christoffel][chi, iota, `~alpha`]*Physics[Christoffel][`~iota`, `~beta`, `~chi`]-(1/4)*Physics[Christoffel][`~alpha`, rho, `~beta`]*Physics[Christoffel][`~rho`, rho1, `~rho1`]+(1/4)*Physics[Christoffel][`~alpha`, rho, `~rho1`]*Physics[Christoffel][`~rho`, rho1, `~beta`]-(1/2)*Physics[Christoffel][omicron, zeta, `~omicron`]*Physics[Christoffel][`~zeta`, `~alpha`, `~beta`]+(1/2)*Physics[Christoffel][omicron, zeta, `~beta`]*Physics[Christoffel][`~zeta`, `~alpha`, `~omicron`]-(1/4)*Physics[Christoffel][`~beta`, psi, `~alpha`]*Physics[Christoffel][`~psi`, omega, `~omega`]+(1/4)*Physics[Christoffel][`~beta`, psi, `~omega`]*Physics[Christoffel][`~psi`, omega, `~alpha`]+(1/2)*Physics[Christoffel][`~tau`, upsilon, `~alpha`]*Physics[Christoffel][`~upsilon`, tau, `~beta`]-(1/2)*Physics[Christoffel][`~tau`, `~alpha`, `~beta`]*Physics[Christoffel][`~upsilon`, tau, upsilon]+(1/4)*Physics[Christoffel][`~beta`, nu, sigma]*Physics[Christoffel][`~sigma`, `~alpha`, `~nu`]-(1/4)*Physics[Christoffel][`~beta`, sigma, `~nu`]*Physics[Christoffel][`~sigma`, nu, `~alpha`]-(1/4)*Physics[Christoffel][`~alpha`, lambda, `~mu`]*Physics[Christoffel][`~lambda`, mu, `~beta`]+(1/4)*Physics[Christoffel][`~alpha`, lambda, mu]*Physics[Christoffel][`~lambda`, `~beta`, `~mu`]+(1/4)*(2*Physics[Christoffel][chi, iota, kappa]*Physics[Christoffel][`~iota`, `~chi`, `~kappa`]-2*Physics[Christoffel][chi, iota, `~chi`]*Physics[Christoffel][`~iota`, kappa, `~kappa`]-2*Physics[Christoffel][alpha4, alpha5, alpha6]*Physics[Christoffel][`~alpha6`, `~alpha4`, `~alpha5`]+2*Physics[Christoffel][alpha4, alpha6, `~alpha5`]*Physics[Christoffel][`~alpha6`, alpha5, `~alpha4`]-2*D_[`~alpha5`](Physics[Christoffel][alpha4, alpha5, `~alpha4`], [X])+2*Physics[Christoffel][`~alpha1`, alpha1, alpha3]*Physics[Christoffel][`~alpha3`, alpha2, `~alpha2`]-2*Physics[Christoffel][`~alpha1`, alpha3, `~alpha2`]*Physics[Christoffel][`~alpha3`, alpha1, alpha2]+2*Physics[Ricci][alpha2, `~alpha2`]+2*D_[`~alpha2`](Physics[Christoffel][`~alpha1`, alpha1, alpha2], [X]))*Physics[g_][`~alpha`, `~beta`]+(1/2)*Physics[Christoffel][alpha10, `~alpha`, `~beta`]*Physics[Christoffel][alpha9, `~alpha10`, `~alpha9`] = 0)

    (1/2)*Physics:-Ricci[chi, `~chi`]*Physics:-g_[`~alpha`, `~beta`]-Physics:-Ricci[`~alpha`, `~beta`] = 0

    (30)

    NULL


     

    Download Einstein_Equations_From_First_Principles.mw

    Edgardo S. Cheb-Terrab
    Physics, Differential Equations and Mathematical Functions

    I’m absolutely delighted to announce the launch of Maple 2025!

    Although you see a new release every year, new features take anything from a few fast-paced weeks to develop, to months of careful cultivation.

    Working on so many features in parallel, each with varying time scales, isn't easy! We have to fastidiously manage and track our work.

    So it's easy to lose ourselves in the daily minutiae of software development. To help us maintain perspective, we constantly ask ourselves questions like:

    • What user problem are we solving and how often does this problem occur?
    • Can we validate our proposed solution with preliminary user feedback?
    • Is this a solution to a problem that doesn't exist and will never exist, or are we pre-empting a future need?
    • Are we offering value to our users?

    Given the answers, we course-correct to make sure we stay on track for our central mission - to make you happy, and to keep you coming back year-after-year.

    With Maple 2025, I think we've smashed that goal. We have many new features that'll appeal to many different types of users - from students, educators and mathematicians, to engineers, scientists and technical professionals

    Let me walk you through some of my personal highlights.

    It’ll be difficult for anyone to miss this - Maple 2025 has a new interface! It’s a ribbon-based UI that look clean and contemporary, and helps you find and discover tools more quickly than before.

    You have large, meaningful icons.

    Items are logically grouped.

    The ribbons is contextual. If you click on a plot, you get new tabs for interacting with and drawing on the plot.

    A new Education tab collects pedagogical resources that were scattered around the interface in prior releases.

    This is the biggest visual overhaul to Maple in many years. We hope you like it! 

    We also appreciate that changes in look and feel can be divisive. Please rest assured that we will refine and finesse the interface with each successive release; your comments and suggestions are most welcome.

    The new interface is available on Windows and Linux, and as a technology preview on Mac.

    The right arrow key on my keyboard is wearing out…and it’s all because of Maple. I’m knee deep in Maple nearly every day entering equations, and I’m always using right-arrow to move the cursor. It gets kind of tedious!

    This anecdote reflects some investigative work we did. We comprehensively examined our internal library of thousands of Maple worksheets and discovered that these three input patterns are extremely common.

    Previously, you’d use the right-arrow key to move the cursor out of the exponential, division or subscript.

    Now, in Maple 2025, when you

    • type ^, /, or enter a literal subscript with a double-underscore,
    • followed by a number or symbol
    • and then input another operator (such as +)

    the operator is automatically inserted on the baseline (except when y = 1).

    Of course, you can also make the cursor return to or stay in the exponent or denominator with a simple keystroke, when that is what is needed.

    This is one of those little quality of life refinements that I’m very fond of - it’s a little visual and usability dopamine hit.

    The sum command (and its typeset form) now indexes into vectors without you needing to spam unevaluation quotes all over your expression.

    Maple 2024

    Maple 2025

    We’ve been integrating units deeper into the Maple system, release after release. Much of this is driven by our engineering users.

    A few releases ago, we made int(numeric) compatible with units. With Maple 2025, you can now numerically differentiate  expressions and procedures that have units.

    I’m a grizzled thermodynamics hack, so here’s an example in which I calculate the specific heat capacity of water by differentiating enthalpy with respect to temperature (and then confirm the result with the built-in value):

    This is in addition to many other improvements to the units experience.

    Although this is a part of Maple that I don’t touch often (my colleague Karishma takes point on the education side), I REALLY wish I’d had this when I was struggling with math.

    You can now automatically generate unlimited variants of the same problem for students to solve with the Try Another feature, which has been added to Maple’s Check My Work tools (another feature I really could have used!). This is available for many common math principles, including factorization, simplification, integration and more.

    This is just one of the improvements in Maple 2025 for teaching and learning.

     If you’ve ever found yourself going back and forth (and back and forth) between two large, almost identical-looking Maple expressions, trying to figure out how they are different, you’re going to love this one.  ExpressionTools is a new package that lets you compare the differences between two expressions.

    I really like the use of color to highlight differences. Less squinting at the screen!

    You can now run Maple Flow worksheets from Maple (you don’t need Maple Flow installed to do this). You can send parameters into the Flow worksheet and extract your desired results.

    This means you can use the entire flexibility of Maple to analysis and manipulate your Flow worksheet. You could, for example:

    • Attach a Flow worksheet to a Maple workbook and create an interactive application
    • Carry out parameter studies of a Flow worksheet by evaluating it over many parameter sets in Maple
    • Create an Excel interface for a Flow worksheet using the Maple add-in for Excel

    Simplify is one of those functions that literally tens of thousands of people use each day. Every time we make an incremental improvement, the cumulative benefits across our entire user base are significant.

    We’ve refined simplify in a number of critical ways. For example, simplify now recognizes when exponentials can be profitably converted to hyperbolic trig functions:

    The analysis of many scientific phenomena result in Laplace transforms that do not have a symbolic inverse which can be expressed in terms of elementary functions. This includes applications in heat transfer, fluid mechanics, fractional diffusion processes, control systems and electrical transmission.

    For example, this monster Laplace transform results from an analysis of voltage on a transmission line:

    You can now numerically invert this transform courtesy of an enhancement to inttrans:-invlaplace - a fast quadrature method.

    I’ve saved what I think has the most future potential for last.

    I’m sure nearly all of you have experimented with the various AI tools. They’re an inevitable part of our present and future, whether we're comfortable with it or not.

    This is something we've been mulling over for some time.

    • In Maple 2019, the DeepLearning package made its debut. This package provides tools for machine learning, supporting operations such as classification and regression using neural networks.
    • In Maple 2024, we introduced an AI-powered formula lookup feature.

    In Maple 2025, we’re giving you an early-stage technology preview of AI-powered document generation.

    You can automatically generate worksheet content by prompting an AI, and then gradually refine the content

    If you’re an educator, you might want some content that describes applications of calculus. So you might ask the AI “How do I derive the formula for the area of a circle” by entering your prompt into this text box:

    This is the worksheet content that may be returned:

    If you’re structural engineer who wants to know how to calculate the hardness of concrete, you might ask the AI: “How do I calculate the compressive strength of slow hardening concrete as a function of time? Use the CEB-FIP Model Code 90. Include a worked example with Maple code”.

    This worksheet content that could be generated (note the live Maple code):

    We’re labelling AI-generated worksheet content as a technology preview. You might see

    • text that might be misleading (but sounds plausible)
    • code that doesn’t work (but looks plausible)
    • or different results each time you click “Generate Document”

    For the moment, I would not rely on AI-generated worksheet content without realistic expectations, a healthy dose of scepticism and a modicum of detached analysis. But AI models are rapidly growing in robustness, and we want to position ourselves to best exploit their future potential. The next few years will be VERY exciting.

    We can never cover everything in a short blog post like this. So if you want to know more, head on over to the What’s New pages for Maple 2025!

    Hi MaplePrimes,
    I made a quick code to calculate Aliquot Sequences.

    The code works.

    I was inspired by a Numberphile YouTube video.

    see

    aliquot_sequence_cut_1.mw

    aliquot_sequence_cut_1.pdf

    This should be helpful.

    Regards,

    Matt

    LIMITS

    Limits in maths are defined as the values that a function approaches the output for the given input values. Limits play a vital role in calculus and mathematical analysis and are used to define integrals, derivatives, and continuity. It is used in the analysis process, and it always concerns the behavior of the function at a particular point. The limit of a sequence is further generalized in the concept of the limit of a topological net and related to the limit and direct limit in the theory category. Generally, the integrals are classified into two types namely, definite and indefinite integrals. For definite integrals, the upper limit and lower limits are defined properly. Whereas indefinite integrals are expressed without limits, and it will have an arbitrary constant while integrating the function.

    Sometimes we can't work something out directly ... but we can see what it should be as we get closer and closer!

    Example 1

    "restart;  f(x):=(|x|-3)/(x-3);"

    proc (x) options operator, arrow, function_assign; (abs(x)-3)/(x-3) end proc

    (1)

    plot(f(x), x = -10 .. 10, discont = true, color = "Green")

     

    f(3)

    Error, (in f) numeric exception: division by zero

     

    Now 0/0 is a difficulty! We don't really know the value of 0/0 (it is "indeterminate"), so we need another way of answering this.

    So instead of trying to work it out for x=3 let's try approaching it closer and closer:

    f(3.01)

    1.000000000

    (2)

    f(3.0000001)

    1.000000000

    (3)

    f(2.9999999)

    1.000000000

    (4)

    Limit(f(x), x = 3)

    Limit((abs(x)-3)/(x-3), x = 3)

    (5)

    limit(f(x), x = 3)

    1

    (6)

    limit(f(x), x = 3, left)

    1

    (7)

    limit(f(x), x = 3, right)

    1

    (8)

    Example 2

    Sometimes some functions are not continuous. That is, they appear to be approaching two different values when they are approached from two sides.

    "g(x):=piecewise(0<x<2,1/(2 x-x^(2)),2 <x<=3,2 -x,3<x<4,x-4, 4<=x,Pi,undefined);"

    proc (x) options operator, arrow, function_assign; piecewise(0 < x and x < 2, 1/(2*x-x^2), 2 < x and x <= 3, 2-x, 3 < x and x < 4, x-4, 4 <= x, Pi, undefined) end proc

    (9)

    plot(g(x), x = -10 .. 10, y = -1 .. 10, discont = true, color = "Red")

     

    Suppose we want to approach 2 and see the function’s limit. This naturally leads to directions from which we can approach. Left-hand side and the right-hand side limits.

    The right-hand side limit is the value of the function that it takes while approaching it from the right-hand side of the desired point. Similarly, the left-hand side limit is the value of function while approaching it from the left-hand side.

    eval(g(x), x = 2)

    undefined

    (10)

    limit(g(x), x = 2, left)

    infinity

    (11)

    limit(g(x), x = 2, right)

    0

    (12)

    limit(g(x), x = 2)

    undefined

    (13)

    And the ordinary limit "does not exist".

    g(4)

    Pi

    (14)

    limit(g(x), x = 4, left)

    0

    (15)

    limit(g(x), x = 4, right)

    Pi

    (16)

    limit(g(x), x = 4)

    undefined

    (17)

    And the ordinary limit "does not exist".

    with(Student[Calculus1]); LimitTutor()

    Example 3

    Estimate the value of the following limit limit(h(x)*where, x = 2), h(x) = piecewise(x <> 2, x+12, x = 2, 4).

    "h(x):={[[x+12,x<>2],[4,x=2]];"

    proc (x) options operator, arrow, function_assign; piecewise(x <> 2, x+12, x = 2, 4) end proc

    (18)

    plot(h(x), x = -10 .. 10, discont = true, color = "#40e0d0")

     

    limit(h(x), x = 2)

    14

    (19)

    The limit is NOT 2025!Remember from the first example that limits do not care what the function is actually doing at the point in question. Limits are only concerned with what is going on around the point. Since the only thing about the function that we actually changed was its behavior at x = 2 this will not change the limit.

    Example 4

    " w(x):=piecewise( x<0,-x+5,x>=0,2 x);"

    proc (x) options operator, arrow, function_assign; piecewise(x < 0, -x+5, 0 <= x, 2*x) end proc

    (20)

    plot(w(x), x = -10 .. 10, y = -10 .. 10, discont = true, color = "Blue")

     

    limit(w(x), x = 5)

    10

    (21)

    limit(w(x), x = 6, left)

    12

    (22)

    limit(w(x), x = 1, right)

    2

    (23)

    Example 5

    " k(x):=piecewise( x<5,x+4,x>=5, x^(2)-2);"

    proc (x) options operator, arrow, function_assign; piecewise(x < 5, x+4, 5 <= x, x^2-2) end proc

    (24)

    plot(k(x), x = -10 .. 10, discont = true, color = orange)

     

    limit(k(x), x = 2)

    6

    (25)

    limit(k(x), x = 5, left)

    9

    (26)

    limit(k(x), x = 5, right)

    23

    (27)

    limit(k(x), x = 5)

    undefined

    (28)

    limit(k(x), x = 6)

    34

    (29)

    Example 6

    restart

    " l(x):=piecewise( x<=1,(x-8)/(x-3),x>=3, sqrt(x^(2)+x+2), undefined);"

    proc (x) options operator, arrow, function_assign; piecewise(x <= 1, (x-8)/(x-3), 3 <= x, sqrt(x^2+x+2), undefined) end proc

    (30)

    plot(l(x), x = -10 .. 10, discont = true, color = "Blue")

     

    limit(l(x), x = 0)

    8/3

    (31)

    limit(l(x), x = 1, left)

    7/2

    (32)

    limit(l(x), x = 1, right)

    undefined

    (33)

    limit(l(x), x = 2)

    undefined

    (34)

    Example 7

    Estimate the value of the following limit. limit(H(t), t = 0)where, H(t) = piecewise(t < 0, 0, t >= 0, 1)

    "  H(t):=piecewise( t<0,0,t>=0, 1);"

    proc (t) options operator, arrow, function_assign; piecewise(t < 0, 0, 0 <= t, 1) end proc

    (35)

    This function is often called either the Heaviside or step function. We could use a table of values to estimate the limit, but it’s probably just as quick in this case to use the graph so let’s do that. Below is the graph of this function.

    plot(H(t), t = -10 .. 10, discont = true, color = "Blue")

     

    limit(H(t), t = 0, left)

    0

    (36)

    limit(H(t), t = 0, right)

    1

    (37)

    We can see from the graph that if we approach t = 0from the right side the function is moving in towards a yvalue of 1. Well actually it’s just staying at 1, but in the terminology that we’ve been using in this section it’s moving in towards 1.

    Also, if we move in towards t = 0 from the left the function is moving in towards a yvalue of 0.

    According to our definition of the limit the function needs to move in towards a single value as we move in towards t = a (from both sides). This isn’t happening in this case and so in this example we will also say that the limit doesn’t exist.

     

    NULL

    Download limits.mw

    1 2 3 4 5 6 7 Last Page 1 of 304