How to make set of equations appear side by side using empheq package?

Honestly I find empheq quite the overkill here.

\documentclass{article}

\usepackage[margin=.2in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage{amsmath}% or empheq, which loads mathtools, which loads amsmath

\begin{document}
Lorem ipsum dolor sit et amet.
\[
\boxed{
\begin{aligned}
\sin(A+B)&=\sin A\cos B+\cos A\sin B\\
\sin(A-B)&=\sin A\cos B-\cos A\sin B\\
\cos(A+B)&=\cos A\cos B-\sin A\sin B\\
\cos(A-B)&=\cos A\cos B+\sin A\sin B
\end{aligned}}
\quad
\boxed{
\begin{aligned}
\sin(A+B)+\sin(A-B)&=2\sin A\cos B\\
\sin(A+B)-\sin(A-B)&=2\cos A\sin B\\
\cos(A-B)+\cos(A+B)&=2\cos A\cos B\\
\cos(A-B)-\cos(A+B)&=2\sin A\sin B
\end{aligned}}
\]
Lorem ipsum dolor sit et amet.
\end{document}

enter image description here

You need an awfully small margin to fit that though...


I propose this coloured version:

\documentclass[11pt]{article}

\usepackage[svgnames]{xcolor}
\usepackage[margin=.2in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage{empheq}
\makeatletter
    \newcommand{\colorboxed}[3][white]{\fcolorbox{#2}{#1}{\m@th$\displaystyle#3$}}
\makeatother

\begin{document}

\[ \setlength{\fboxsep}{0.5em}\setlength{\fboxrule}{1pt}\colorboxed{IndianRed}{\begin{aligned}
\sin(A+B)&=\sin A\cos B+\cos A\sin B\\
\sin(A-B)&=\sin A\cos B-\cos A\sin B\\
\cos(A+B)&=\cos A\cos B-\sin A\sin B\\
\cos(A-B)&=\cos A\cos B+\sin A\sin B
\end{aligned}}
\qquad
\colorboxed[LavenderBlush!40]{IndianRed}{\begin{aligned}
\sin(A+B)+\sin(A-B)&=2\sin A\cos B\\
\sin(A+B)-\sin(A-B)&=2\cos A\sin B\\
\cos(A-B)+\cos(A+B)&=2\cos A\cos B\\
\cos(A-B)-\cos(A+B)&=2\sin A\sin B
\end{aligned}}
\]

\end{document} 

enter image description here

Unrelated: Needless to load amsmath when you load mathtools: the latter does it for you. Similar remark for mathtools and empheq.

Tags:

Align

Empheq