diff --git a/composer.json b/composer.json
index 6bb0c49e7d76d1cc7f7b1878f816196bc98e6894..30169182527e49e5bdad4783101e7ac60811dcc2 100644
--- a/composer.json
+++ b/composer.json
@@ -127,7 +127,7 @@
         "drupal/libraries": "4.0",
         "drupal/link_attributes": "1.12",
         "drupal/linkit": "5.0-beta13",
-        "drupal/mathjax": "3.0.1",
+        "drupal/mathjax": "4.0.2",
         "drupal/media_entity_browser": "2.0-alpha4",
         "drupal/media_entity_file_replace": "^1.0",
         "drupal/media_entity_twitter": "2.9",
diff --git a/composer.lock b/composer.lock
index e00751c8a02dfc6b5746fe6157300b76a6f9570c..c99c2f904ce1c1a44095252d0203140485540258 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "c2bb47d13bfe53e2d75bb64e53de9e82",
+    "content-hash": "5e44a8642c1a018223a53f36ef6178a1",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -5156,26 +5156,26 @@
         },
         {
             "name": "drupal/mathjax",
-            "version": "3.0.1",
+            "version": "4.0.2",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/mathjax.git",
-                "reference": "3.0.1"
+                "reference": "4.0.2"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/mathjax-3.0.1.zip",
-                "reference": "3.0.1",
-                "shasum": "0298e9e464512d7be51cbfc87404ce2529b30f5f"
+                "url": "https://ftp.drupal.org/files/projects/mathjax-4.0.2.zip",
+                "reference": "4.0.2",
+                "shasum": "e92f2f50aa8149e55af8b1f744cad84cf680d91f"
             },
             "require": {
-                "drupal/core": "^8 || ^9"
+                "drupal/core": "^9.1 || ^10"
             },
             "type": "drupal-module",
             "extra": {
                 "drupal": {
-                    "version": "3.0.1",
-                    "datestamp": "1673381690",
+                    "version": "4.0.2",
+                    "datestamp": "1673381514",
                     "security-coverage": {
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 2bb2704405e0df2735a5fbac27bb305ecc206938..abef8a072ab979df77d2ef22d43eaa3a1b3ebb82 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -5351,27 +5351,27 @@
         },
         {
             "name": "drupal/mathjax",
-            "version": "3.0.1",
-            "version_normalized": "3.0.1.0",
+            "version": "4.0.2",
+            "version_normalized": "4.0.2.0",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/mathjax.git",
-                "reference": "3.0.1"
+                "reference": "4.0.2"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/mathjax-3.0.1.zip",
-                "reference": "3.0.1",
-                "shasum": "0298e9e464512d7be51cbfc87404ce2529b30f5f"
+                "url": "https://ftp.drupal.org/files/projects/mathjax-4.0.2.zip",
+                "reference": "4.0.2",
+                "shasum": "e92f2f50aa8149e55af8b1f744cad84cf680d91f"
             },
             "require": {
-                "drupal/core": "^8 || ^9"
+                "drupal/core": "^9.1 || ^10"
             },
             "type": "drupal-module",
             "extra": {
                 "drupal": {
-                    "version": "3.0.1",
-                    "datestamp": "1673381690",
+                    "version": "4.0.2",
+                    "datestamp": "1673381514",
                     "security-coverage": {
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 5ae27e9686df92f6d21008291208cd1e8ddc6906..d8bae5bfa0ec8eac6bb42401e74118c2c297631a 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
         'name' => 'osu-asc-webservices/d8-upstream',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '76170104ccd58f4dee5ecfcce96b1acdc257252c',
+        'reference' => '4cbb2152350103f297f5852d6a6816b907061d82',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -896,9 +896,9 @@
             'dev_requirement' => false,
         ),
         'drupal/mathjax' => array(
-            'pretty_version' => '3.0.1',
-            'version' => '3.0.1.0',
-            'reference' => '3.0.1',
+            'pretty_version' => '4.0.2',
+            'version' => '4.0.2.0',
+            'reference' => '4.0.2',
             'type' => 'drupal-module',
             'install_path' => __DIR__ . '/../../web/modules/mathjax',
             'aliases' => array(),
@@ -1549,7 +1549,7 @@
         'osu-asc-webservices/d8-upstream' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '76170104ccd58f4dee5ecfcce96b1acdc257252c',
+            'reference' => '4cbb2152350103f297f5852d6a6816b907061d82',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
diff --git a/web/modules/mathjax/mathjax.info.yml b/web/modules/mathjax/mathjax.info.yml
index 4380b0e5e474caf9370437a0b1d67bc39e99a8f0..eb84fa146e4b97d529704ef472c4a94103c8cb04 100644
--- a/web/modules/mathjax/mathjax.info.yml
+++ b/web/modules/mathjax/mathjax.info.yml
@@ -1,7 +1,7 @@
 name: MathJax
 type: module
 description: Javascript-based LaTeX rendering solution for your Drupal website.
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^9.1 || ^10
 configure: mathjax.settings
 libraries:
   - mathjax/setup
@@ -9,6 +9,6 @@ libraries:
   - mathjax/config
 
 # Information added by Drupal.org packaging script on 2023-01-10
-version: '3.0.1'
+version: '4.0.2'
 project: 'mathjax'
-datestamp: 1673381692
+datestamp: 1673381516
diff --git a/web/modules/mathjax/tests/src/Functional/MathjaxWebTest.php b/web/modules/mathjax/tests/src/Functional/MathjaxWebTest.php
index 7035a4821f5da643dfec3c926e2855bb1ffc2300..0d7d3be2474187348690b3435c92c33ab765176d 100644
--- a/web/modules/mathjax/tests/src/Functional/MathjaxWebTest.php
+++ b/web/modules/mathjax/tests/src/Functional/MathjaxWebTest.php
@@ -43,7 +43,7 @@ public static function getInfo() {
    *
    * @var array
    */
-  public static $modules = ['mathjax', 'filter'];
+  protected static $modules = ['mathjax', 'filter'];
 
   /**
    * Set up the test environment.
@@ -67,16 +67,16 @@ public function testAdmin() {
     $config = Drupal::config('mathjax.settings');
     $this->drupalLogin($this->administrator);
     $this->drupalGet('admin/config');
-    $this->assertText('Configure global settings for MathJax.');
+    $this->assertSession()->pageTextContains('Configure global settings for MathJax.');
     $this->drupalGet('admin/config/content/formats/add');
-    $this->assertText('Mathematics inside the configured delimiters is rendered by MathJax');
+    $this->assertSession()->pageTextContains('Mathematics inside the configured delimiters is rendered by MathJax');
     $this->drupalGet('admin/config/content/mathjax');
-    $this->assertTitle('MathJax | Drupal');
-    $this->assertText('MathJax CDN URL');
-    $this->assertFieldByName('cdn_url', $config->get('cdn_url'));
-    $this->assertText('Enter the MathJax CDN url here or leave it unchanged to use the one provided by www.mathjax.org.');
-    $this->assertText('Configuration Type');
-    $this->assertFieldByName('config_type', 0);
+    $this->assertSession()->titleEquals('MathJax | Drupal');
+    $this->assertSession()->pageTextContains('MathJax CDN URL');
+    $this->assertSession()->fieldValueEquals('cdn_url', $config->get('cdn_url'));
+    $this->assertSession()->pageTextContains('Enter the MathJax CDN url here or leave it unchanged to use the one provided by www.mathjax.org.');
+    $this->assertSession()->pageTextContains('Configuration Type');
+    $this->assertSession()->fieldValueEquals('config_type', 0);
 
     $custom = '{"tex2jax":{"inlineMath":[["#","#"],["\\(","\\)"]],"processEscapes":"true"},"showProcessingMessages":"false","messageStyle":"none"}';
     $path = 'admin/config/content/mathjax';
@@ -84,10 +84,11 @@ public function testAdmin() {
       'config_type' => 1,
       'config_string' => $custom,
     ];
+    $this->drupalGet($path);
 
-    $this->drupalPostForm($path, $edit, t('Save configuration'));
-    $this->assertText('Enter a JSON configuration string as documented');
-    $this->assertRaw(htmlentities($custom));
+    $this->submitForm($edit, t('Save configuration'));
+    $this->assertSession()->pageTextContains('Enter a JSON configuration string as documented');
+    $this->assertSession()->responseContains(htmlentities($custom));
   }
 
   /**
@@ -96,14 +97,14 @@ public function testAdmin() {
   public function testLibraryDetection() {
     $this->drupalLogin($this->administrator);
     $this->drupalGet('admin/reports/status');
-    $this->assertNoText('MathJax is configured to use local library files but they could not be found. See the README.');
+    $this->assertSession()->pageTextNotContains('MathJax is configured to use local library files but they could not be found. See the README.');
     $this->drupalGet('admin/config/content/mathjax');
     $edit = [
       'use_cdn' => FALSE,
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+    $this->submitForm($edit, t('Save configuration'));
     $this->drupalGet('admin/reports/status');
-    $this->assertText('MathJax is configured to use local library files but they could not be found. See the README.');
+    $this->assertSession()->pageTextContains('MathJax is configured to use local library files but they could not be found. See the README.');
   }
 
   /**
@@ -114,12 +115,12 @@ public function testFilterOrder() {
     // Activate the MathJax filter on the plain_text format.
     $this->drupalGet('admin/config/content/formats/manage/plain_text');
     $edit = ['filters[filter_mathjax][status]' => TRUE];
-    $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+    $this->submitForm($edit, t('Save configuration'));
     $this->drupalGet('admin/config/content/formats/manage/plain_text');
     // Ensure that MathJax appears at the bottom of the active filter list.
     $count = count($this->xpath("//div[@id='edit-filters-status']/div/input[@class='form-checkbox' and @checked='checked']"));
     $result = $this->xpath("//table[@id='filter-order']/tbody/tr[$count]/td[1]");
-    $this->assertEqual($result[0]->getText(), 'MathJax');
+    $this->assertEquals($result[0]->getText(), 'MathJax');
   }
 
 }