# Prove: If A and B are n times n diagonal matrices, then AB = BA.

Prove: If A and B are $n×n$ diagonal matrices, then
AB = BA.
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Asma Vang
Step 1
Given, A and B are $n×n$ diagonal matrices
Step 2
Suppose
$A=\left[\begin{array}{cccc}{a}_{11}& 0& \dots & 0\\ c& {a}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {a}_{nn}\end{array}\right],B=\left[\begin{array}{cccc}{b}_{11}& 0& \dots & 0\\ 0& {b}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {b}_{nn}\end{array}\right]$
Now
L.H.S.=AB
$=\left[\begin{array}{cccc}{a}_{11}& 0& \dots & 0\\ c& {a}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {a}_{nn}\end{array}\right]\left[\begin{array}{cccc}{b}_{11}& 0& \dots & 0\\ 0& {b}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {b}_{nn}\end{array}\right]$
$=\left[\begin{array}{cccc}{a}_{11}{b}_{11}& 0& \dots & 0\\ 0& {a}_{22}{b}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {a}_{nn}{b}_{nn}\end{array}\right]$
Now
R.H.S.=BA
$=\left[\begin{array}{cccc}{b}_{11}& 0& \dots & 0\\ 0& {b}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {b}_{nn}\end{array}\right]\left[\begin{array}{cccc}{a}_{11}& 0& \dots & 0\\ c& {a}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {a}_{nn}\end{array}\right]$
$=\left[\begin{array}{cccc}{b}_{11}{a}_{11}& 0& \dots & 0\\ 0& {b}_{22}{a}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {b}_{nn}{a}_{nn}\end{array}\right]$
$=\left[\begin{array}{cccc}{a}_{11}{b}_{11}& 0& \dots & 0\\ 0& {a}_{22}{b}_{22}& \dots & 0\\ ⋮& ⋮& \ddots & 0\\ 0& 0& \dots & {a}_{nn}{b}_{nn}\end{array}\right]$
Thus AB=BA
Jeffrey Jordon
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 17, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://plainmath.net/3602/prove-if-a-and-b-are-n-times-n-diagonal-matrices-then-ab-equal-ba", "fetch_time": 1656212711000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2022-27/segments/1656103036363.5/warc/CC-MAIN-20220626010644-20220626040644-00493.warc.gz", "warc_record_offset": 502745005, "warc_record_length": 13975, "token_count": 831, "char_count": 1773, "score": 4.40625, "int_score": 4, "crawl": "CC-MAIN-2022-27", "snapshot_type": "latest", "language": "en", "language_score": 0.45357632637023926, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00001-of-00064.parquet"}