\( \DeclareMathOperator*{\oidotsint}{{\Huge{\subset\!\supset}} \llap{\idotsint}} \) \( \DeclareMathOperator*{\oidotsintV}{ \begin{tikzpicture} \node[draw, ellipse, inner xsep=-4pt, inner ysep=-12pt]\end{tikzpicture}
{\displaystyle\idotsint\limits_V}
} \)  Introduction
Suppose we have a 6D robot arm c-space \(Q\) and a Lagrangian on this c-space. This gives rise to a 12-dim'l tangent vector field \(\vec{F}\) on the tangent bundle \(TQ\) of the c-space (a second-order ODE on \(Q\)). Suppose we want to know if this vector field has a scalar potential function. There is no way to take the "curl" of this vector field. However, the c-space \(Q\) has a natural inertial Riemannian metric \(g\) which lifts naturally to a Riemannian metric \(\tilde{g}\) on \(TQ\). Using this Riemannian metric on \(TQ\), we may compute via the musical isomorphism from \(TTQ\) to \(T^*TQ\ (= \Lambda^1(TQ))\) a 1-form \(\omega = \vec{F}^{\flat}\) and then take the exterior derivative \(\eta = d\omega\) of that 1-form \(\omega\); this functions as a "curl" of the vector field. If \(d\omega \ne 0\), automatically \(\vec{F}\) does not have a scalar potential function, as is the case in vector calculus. If \(d\omega = 0\) (in this case, we say \(\omega\) is a closed 1-form), we need to consider the loops in \(TQ\) that do not bound a disk in \(TQ\) to see if \(\vec{F}\) has a scalar potential function. If \(Q\) (and therefore \(TQ\)) is simply-connected (or, more generally, if the Abelianization of \(\pi_1(Q)\) is 0 or contains only torsion), then we are done: \(\omega\) has an antiderivative 0-form \(f\) with \(df = \omega\) (in this case, we call \(\omega\) an exact 1-form), and, for this 0-form, if we set \(\phi = -f\), we have \(-\vec{\nabla}\phi = \vec{\nabla}f = (df)^{\#} = \omega^{\#} = \vec{F}\), so \(\phi\) is a (physics-style) scalar potential function for \(\vec{F}\). If not, for each homotopy class of loops in \(TQ\) that does not bound a disk in \(TQ\), identify an oriented, embedded copy of \(S^1\) which does not bound a disk in \(TQ\) due to that "1D hole", compute the period \(\displaystyle \oint\limits_{[S^1]} \omega \left(= \oint\limits_{[S^1]} \vec{F} \cdot d\vec{r}\right)\) of \(\omega\) (resp. \(\vec{F}\)) over that oriented, embedded copy of \(S^1\) "encircling" that "1D hole": if the period of \(\omega\) (resp. \(\vec{F}\)) over each "1D hole" in \(TQ\) is 0, \(\omega\) again has an antiderivative 0-form \(f\) with \(df = \omega\) (in this case, we call \(\omega\) an exact 1-form), and, for this 0-form, if we set \(\phi = -f\), we have \(-\vec{\nabla}\phi = \vec{\nabla}f = (df)^{\#} = \omega^{\#} = \vec{F}\), so \(\phi\) is a (physics-style) scalar potential function for \(\vec{F}\); if not -- that is, if at least one period of \(\omega\) (resp. \(\vec{F}\)) over at least one "1D hole" is not 0 -- then \(\omega\) has no antiderivative 0-form and \(\vec{F}\) does not have a scalar potential function.

[Add a part about a \(\vec{B}\) field being represented by a 2-form, and that only if its exterior derivative "div" 3-form is 0 and it is not a generator of \(H^2_{\text{dR}}(Q)\) does the \(\vec{B}\) field have an antiderivative vector potential function \(\vec{A}\)?]

In this latter case, we call \(\omega\) a generator of \(H^1_{\text{dR}}(TQ)\), the 1-dimension de Rham cohomology group of \(\bf{TQ}\): this is precisely when \(\omega\) is a closed but not exact 1-form. Note that every exact 1-form is necessarily closed: if \(\omega = df\), then \(d\omega = ddf = 0\). The goal of de Rham cohomology is to determine the differential \(k\)-forms on a manifold that are closed but not exact; these are in bijective correspondence with the "\(k\)-dim'l holes" of the manifold (up to an equivalence relation on the \(k\)-forms and an equivalence relation on the "\(k\)-dim'l holes"): for every ."\(k\)-dim'l hole" in a manifold \(M^n\), there is a unique orientable, closed \(k\)-dim'l manifold \(V^k\) which does not bound a compact \(k+1\)-dim'l manifold in \(M\) due to that "hole" (unique up to an equivalence relation called cobordance) and a unique differential \(k\)-form \(\theta\) on \(M\) (unique up to the equivalence relation of differing from another closed form by an exact form) with \(\displaystyle \oidotsint\limits_{[V]} \theta \ne 0\). This bijective correspondence between \(k\)-dim'l "holes" and closed but not exact differential \(k\)-forms on \(M\) is known as de Rham's Theorem. The orientable, closed \(k\)-dim'l manifold \(V^k\) and the differential \(k\)-form \(\theta\) are called Poincaré duals of each other. For each "independent" "\(k\)-dim'l hole" in \(M\), we pick up a factor of \(\mathbb{R}\) in the \(\bf{k}\)-dimensional de Rham homology group of \(\bf{M}\), \(H_{k, \text{dR}}(M)\), so that if there are 3 "independent" "holes", \(H_{k, \text{dR}}(M) \cong \mathbb{R}^3\). For each "independent" closed but not exact \(k\)-form on \(M\), we also pick up a factor of \(\mathbb{R}\) in the \(\bf{k}\)-dimensional de Rham cohomology group of \(\bf{M}\), \(H^k_{\text{dR}}(M)\), so that if there are 5 "independent" closed but not exact \(l\)-forms on \(M\), \(H^l_{\text{dR}}(M) \cong \mathbb{R}^5\). We shall describe later ways of computing \(H_{k,\text{dR}}(M)\), such as the Mayer–Vietoris sequence and the Künneth formula.

Almost by convention, \(H_{0,\text{dR}}(Q) \cong \mathbb{R}\) if the c-space \(Q\) of a mechanical system is connected. If \(Q\) is \(n\)-dim'l, again, almost by convention, \(H_{n, \text{dR}}(Q) \cong \begin{cases} \mathbb{R} & \text{if } Q \text{ is closed and  orientable} \\ 0 & \text{otherwise} \end{cases}\). For every \(k\) strictly between 0 and \(n\), by 1) Poincaré duality if \(Q\) is closed and orientable or 2) Lefschetz duality if \(Q\) is compact and orientable but has boundary, \(H_{k, \text{dR}}(Q) \cong H^{n-k}_{\text{dR}}(Q)\). Again, by de Rham's Theorem, \(H_{k, \text{dR}}(Q) \cong H^{k}_{\text{dR}}(Q)\), so we generally only need to compute half of a compact, orientable manifold's de Rham homology groups to completely determine all of both \(H_{*, \text{dR}}(Q)\) and \(H^*_{\text{dR}}(Q)\). Note that the various forms of duality and de Rham's Theorem apply only to c-spaces that are manifolds.

It is really the existence of "\(k\)-dim'l holes" in c-spaces that have a dimension greater than 1 that separates The Fundamental Theorem of Calculus (FTC) from Stokes's Theorem, in this author's opinion. In FTC, if a 1-form \(f\ dx\) has a vertical asymptote, so that there is a "hole" in its interval of definition \([a,b]\), this "hole" separates the domain into two disconnected intervals, \([a,c)\) and \((c,b]\), so that part (a)(i) of FTC states that if the 1-form \(f\ dx\) is differentiable on the closed, bounded interval \([a,b]\), 1) it is closed, as its exterior derivative \(\displaystyle f'\ dx \wedge dx = 0\) and 2) it is exact, since \(H^1_{\text{dR}}([a,b]) \cong H_{1,\text{dR}}([a,b]) \cong 0\), so it has an antiderivative 0-form \(F\). However, with Stokes's Theorem in higher dimensions, if a \(k\)-form \(\omega\) has a "vertical asymptote", this "hole" in the c-space \(Q\) of definition of \(\omega\) does not separate \(Q\) but instead creates de Rham cohomology in \(Q\), so that, even if \(d\omega = 0\), \(\omega\) may be a generator of \(H^k_{\text{dR}}(Q)\) and \(\omega\) need not have an antiderivative \((k-1)\)-form \(\theta\). (The other two parts of the theorems, (a)(ii) that any two antiderivatives differ by an exact form and (b) that the integral of the original form over an orientation of the original manifold is equal to the integral of the antiderivative form over the boundary of the original manifold with the induced orientation, hold mutatis mutandis,)

Problems:
1)(a) \(T^2\) is a Lie group, and therefore its tangent bundle is parallelizable. The de Rham cohomology of a sphere is \(H^k_{\text{dR}}(S^n) \cong \begin{cases} \mathbb{R} & k = 0,n \\ 0 & \text{otherwise} \end{cases}\). Because \(TM\) strong deformation retracts onto \(M\) for any manifold \(M\), \(H^k_{\text{dR}}(TM) \cong H^k_{\text{dR}}(M)\). The unit sphere bundle of a Riemannian manifold is sometimes used to deduce information about its geodesics. Compute the de Rham cohomology of the unit sphere bundle of \(T^2\), \(T^1T^2\). [Hint: This is bundle-isomorphic to \(T^2 \times S^1\).] [Note \(\mathbb{R}P^1\) is diffeomorphic to \(S^1\), so the projective plane bundle is bundle-isomorphic to the unit sphere bundle and therefore has the same de Rham cohomology; see below.]
(b) \(S^3\) is a Lie group, and therefore its tangent bundle is parallelizable. Compute the de Rham cohomology of the unit sphere bundle of \(S^3\), \(T^1S^3\). [Hint: This is bundle-isomorphic to \(S^3 \times S^2\).]
(c) [Extra Credit] The projective plane bundle of a Riemannian manifold is sometimes used instead of the unit sphere bundle to deduce information about its geodesics. Compute the de Rham cohomology of the projective plane bundle of \(S^3\), \(\mathbb{P}^1S^3\). [Hints: (1) This is bundle-isomorphic to \(S^3 \times \mathbb{R}P^2\) 2) \(\mathbb{R}P^2\) is a de Rham cohomology sphere, that is, its de Rham cohomology is isomorphic to the de Rham cohomology of the sphere of the same dimension.]
(d) [Hard] The tangent bundle of \(S^2\) is not parallelizable. Use a spectral sequence (as outlined in, e.g., [1]) to compute the de Rham cohomology of the unit sphere bundle of \(S^2\), \(T^1S^2\). [Hint: This is a  fiber bundle \(S^1 \hookrightarrow T^1S^2 \twoheadrightarrow S^2\).]
(e) [Hard] The tangent bundle of \(S^4\) is not parallelizable. Use a spectral sequence to compute the de Rham cohomology of the unit sphere bundle of \(S^4\), \(T^1S^4\). [Hint: This is a  fiber bundle \(S^3 \hookrightarrow T^1S^4 \twoheadrightarrow S^4\).]
(f) [Hard] Use a spectral sequence to compute the de Rham cohomology of the projective plane bundle of \(S^4\), \(\mathbb{P}^1S^4\). [Hints: 1) This is a  fiber bundle \(\mathbb{R}P^3 \hookrightarrow \mathbb{P}^1S^4 \twoheadrightarrow S^4\) 2) \(\mathbb{R}P^3\) is again a de Rham cohomology sphere.]

2) Compute the de Rham cohomology of the revolute-revolute-prismatic-revolute-revolute (RRPRR) robot arm. [Hint: This c-space \(Q^5\) is diffeomorphic to \(S^1 \times S^1 \times [a,b] \times S^1 \times S^1\).]

3) Compute the de Rham cohomology of the revolute-spherical-prismatic-revolute-revolute (RSPRR) robot arm. [Hint: This c-space \(Q^6\) is diffeomorphic to \(S^1 \times S^2 \times [a,b] \times S^1 \times S^1\).]

4) Use Mathematica with the DifferentialForms.m package to determine if the 1-form \(\displaystyle \omega = \left(\frac{q_1dq_2 - q_2dq_1}{q^2_1 + q^2_2}\right)\) has an antiderivative in the RRPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by a constant). Check your answer.

5) Use Mathematica with the DifferentialForms.m package to determine if the 1-form \(\displaystyle \omega =- \left(\frac{2q_1dq_1 + 2q_2dq_2}{q^2_1 + q^2_2}\right)\) has an antiderivative in the RRPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by a constant). Check your answer.

6) Use Mathematica with the DifferentialForms.m package to determine if the 2-form \(\displaystyle \eta = \left[\frac{q_3(dq_4 \wedge dq_5) + q_4(dq_5 \wedge dq_3) + q_5(dq_3 \wedge dq_4)}{(q^2_3 + q^2_4 + q^2_5)^3}\right]\) has an antiderivative in the RSPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by an exact 1-form). Check your answer.

7) Use Mathematica with the DifferentialForms.m package to determine if the 1-form \(\displaystyle \omega = -\left(\frac{2q_1dq_1 + 2q_2dq_2}{(q^2_1 - q^2_2)^2(q^2_3 + q^2_4)}\right) - \left(\frac{2q_3dq_3 + 2q_4dq_4}{(q^2_1 + q^2_2)(q^2_3 + q^2_4)^2}\right)\) has an antiderivative in the RRPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by a constant). Check your answer.

8) Use Mathematica with the DifferentialForms.m package to determine if the 2-form \(\displaystyle \eta = \left(\frac{q_1dq_2 - q_2dq_1}{q^2_1 + q^2_2}\right) \wedge \left(\frac{q_3dq_4 - q_4dq_3}{q^2_3 + q^2_4}\right)\) has an antiderivative in the RRPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by an exact 1-form). Check your answer.

9) Use Mathematica with the DifferentialForms.m package to determine if the 2-form \(\displaystyle \eta = \left(\frac{q_1dq_2 - q_2dq_1}{q^2_1 + q^2_2}\right) \wedge \left(\frac{-2q_3dq_3 - 2q_4dq_4}{(q^2_3 + q^2_4)^2}\right)\) has an antiderivative in the RRPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) e to compute an antiderivative (Any two antiderivatives will differ by an exact 1-form). Check your answer.

10) Use Mathematica with the DifferentialForms.m package to determine if the 2-form \(\displaystyle \eta = \left(\frac{2q_1dq_1 + 2q_2dq_2}{(q^2_1 + q^2_2)^2}\right) \wedge \left(\frac{2q_3dq_3 + 2q_4dq_4}{(q^2_3 + q^2_4)^2}\right)\) has an antiderivative in the RRPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by an exact 1-form). Check your answer.

11) Use Mathematica with the DifferentialForms.m package to determine if the 3-form \(\displaystyle \zeta = \left(\frac{q_1dq_2 - q_2dq_1}{q^2_1 + q^2_2}\right) \wedge \left[\frac{q_3(dq_4 \wedge dq_5) + q_4(dq_5 \wedge dq_3) + q_5(dq_3 \wedge dq_4)}{(q^2_3 + q^2_4 + q^2_5)^3}\right]\) has an antiderivative in the RSPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by an exact 2-form). Check your answer.

12) Use Mathematica with the DifferentialForms.m package to determine if the 3-form \(\displaystyle \zeta = \left(\frac{-2q_1dq_1 - 2q_2dq_2}{q^2_1 + q^2_2}\right) \wedge \left[\frac{q_3(dq_4 \wedge dq_5) + q_4(dq_5 \wedge dq_3) + q_5(dq_3 \wedge dq_4)}{(q^2_3 + q^2_4 + q^2_5)^3}\right]\) has an antiderivative in the RSPRR robot arm's c-space, and, if it does, use the HomotopyOperator function in the DifferentialForms.m package (and/or DSolve with the musical isomorphism) to compute an antiderivative (Any two antiderivatives will differ by an exact 2-form). Check your answer.

13) (a) Identify the Poincaré dual of each closed but not exact form in 4)-12).
(b) Explain how I identified the closed but not exact and exact forms in each c-space.
(c) Find other (all?) closed but not exact and other exact forms in each c-space.

14) Notice that the HomotopyOperator function (and/or DSolve with the musical isomorphism) always returns an antiderivative (\(k-1\))-form, even in the cases where the \(k\)-form is not exact; explain via The Poincaré Lemma why this is the case.

15) Prove or disprove. (If the statement is true, give a mathematical proof [a simple calculation should suffice for these problems]; if the statement is false, provide a counterexample.)
(a) The wedge product of two closed form is closed.
(b) The wedge product of two closed form is exact.
(c) The wedge product of a closed form with an exact form is closed.
(d) The wedge product of a closed form with an exact form is exact.
(e) The wedge product of two exact forms is closed.
(f) The wedge product of two exact forms is exact.

16) Compute the line integral of the robot arm two ways, once via a parametrization and once via the 1D Stokes's Theorem, FTC for LI https://math.stackexchange.com/questions/4092982/differential-form-integral-work-on-c-space-of-robot-arm/4100518#4100518 (OK, so, this one's pretty simple - just \(mgz\) - but they'll get (a) more realistic and (b) harder as I learn more robotics engineering.)

Bibliography:
[1] Bott, R. and Tu, L.W. (1982) Differential Forms in Algebraic Topology. Springer, New York. https://doi.org/10.1007/978-1-4757-3951-0