%
%	gbb60166@gmail.com	https://unilab.gbb60166.jp/prekou/prekou.htm
%
% aspectratio= は 1610, 169, 149, 54, 32 の中から選べる（省略時は 43）
% C:\texlive\2024\texmf-dist\tex\latex\beamer\beamer.cls
%\documentclass[17pt,dvipdfmx,usepdftitle=false,hyperref={pdfpagemode=FullScreen},aspectratio=169]{beamer}
%\documentclass[17pt,dvipdfmx,usepdftitle=false,hyperref={pdfstartview={XYZ null null 8.00}},aspectratio=169]{beamer}
\documentclass[17pt,dvipdfmx,usepdftitle=false,aspectratio=169]{beamer}
% pdfの栞の字化けを防ぐ
%\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}
% テーマ
\usetheme{Copenhagen}
% navi. symbolsは目立たないが，dvipdfmxを使うと機能しないので非表示に
\setbeamertemplate{navigation symbols}{} 
\usepackage{bxdpx-beamer,pxjahyper,minijs}
%\usepackage{graphicx}
%\usepackage{tkokugo,furikana,tsayusen,shiika,sfkanbun,jdkintou,plext}
\usepackage{type1cm}
\usepackage[deluxe]{otf}
%\usepackage{tikzsymbols}
%\usepackage[dvipdfmx]{graphicx}%
\def\pgfsysdriver{pgfsys-dvipdfmx.def}%（graphicxパッケージを使用しない場合はこの行を有効に）
%\def\pgfsysdriver{pgfsys-dvips.def}%デフォルト
%\usepackage[e]{esvect}
\usepackage{tikz}%（これで、pgfとpgfforが読み込まれます。）
%\usepackage{tikz-3dplot}
\usetikzlibrary{patterns}
%\usetikzlibrary{calc,arrows.meta,angles,intersections,backgrounds}
%\usepackage{animate}
%\usepackage{pgfplots}
%\pgfplotsset{compat=newest}
%\pgfplotsset{compat=newest, every axis/.append style={line width=1pt}}
%\PassOptionsToPackage{dvipdfmx}{graphicx}
\nofiles

\hypersetup{% Jul 18 2023
	pdftitle={プレ高数学科（LaTeX Beamer で汎用PDFプレゼンを作る）},
	pdfauthor={gbb60166@gmail.com},
	pdfsubject={https://unilab.gbb60166.jp/prekou/prekou.htm}
	}

% フォントはお好みで
%\usepackage{txfonts}

\mathversion{bold}
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\seriesdefault}{bx}
\renewcommand{\kanjifamilydefault}{\gtdefault}
\renewcommand{\kanjiseriesdefault}{bx}
\setbeamerfont{title}{size=\normalsize,series=\bfseries}
\setbeamerfont{frametitle}{size=\normalsize,series=\bfseries}
\setbeamertemplate{frametitle}[default][center]
\usefonttheme{professionalfonts}

% 参考にしたURL
% http://windom.phys.hirosaki-u.ac.jp/fswiki/wiki.cgi?page=LaTeX+Beamer%A4%C7%A5%D7%A5%EC%A5%BC%A5%F3%A5%C6%A1%BC%A5%B7%A5%E7%A5%F3

\newcommand{\Slash}[1]{\ooalign{\hfil\kern-3pt／\hfil\crcr$#1$}}
\everymath{\displaystyle}

\newcommand{\maruwaku}[1]{\begin{tikzpicture}[scale=0.7, baseline={([yshift=-22pt] current bounding box.north)}]
\filldraw[color=CUDBlue, line width=1pt, rounded corners=2pt] (-0.1,0)--(2.1,0)--(2.1,1.1)--(-0.1,1.1)--cycle;
\draw(1,0.5) node[white]{#1};
\end{tikzpicture}
}

\setbeamersize{text margin left=5mm,text margin right=5mm}
\fboxrule=0.8pt

\makeatletter
\newcommand{\hooklen}[2]{\settowidth{\@tempdima}{\(#1\)}
%\advance\@tempdima by.3ex
% ↑ 数式モードで式の前後に入るスペースを制御したかったが、
%    難しいのでやめた。段々難解なコードになっているのでやめた方がよい？
\hbox to\@tempdima{\hfil \(#2\)\hfil}}
%■等号付き不等号 by 美文書作成入門
\newcommand{\myleqq}{\mathrel{\mathpalette\gl@align<}}
\newcommand{\mygeqq}{\mathrel{\mathpalette\gl@align>}}
\newcommand{\gl@align}[2]{\lower.6ex\vbox{\baselineskip\z@skip\lineskip\z@
	\ialign{$\m@th#1\hfil##\hfil$\crcr#2\crcr=\crcr}}}
\makeatother

% カラーユニバーサルデザインを調べたつもりだがあまり自信がありません
% http://www.fukushihoken.metro.tokyo.jp/kiban/machizukuri/kanren/color.files/colorudguideline.pdf
% http://jfly.iam.u-tokyo.ac.jp/colorset/

% ■ アクセントカラー小面積を目立たせる高彩度色
\definecolor{CUDRed}{RGB}{255,75,0}
\definecolor{CUDGreen}{RGB}{3,175,122}
\definecolor{CUDBlue}{RGB}{0,90,255}
\definecolor{CUDCyan}{RGB}{77,196,255}
\definecolor{CUDMagenta}{RGB}{153,0,153}
\definecolor{CUDYellow}{RGB}{255,241,0}
\definecolor{CUDBrown}{RGB}{128,64,0}

\definecolor{CUDOrange}{RGB}{246,170,0}

% ■ ベースカラー広い面積の塗り分けに用いる低・中彩度色
\definecolor{CUDPink}{RGB}{255,202,191}
\definecolor{CUDBrightGreen}{RGB}{119,217,168}
\definecolor{CUDLime}{RGB}{216,242,85}
\definecolor{CUDCream}{RGB}{255,255,128}
\definecolor{CUDBrightCyan}{RGB}{191,228,255}
%\definecolor{CUD}{RGB}{}%

\setbeamercolor{CUDBrightGreen}{fg=black,bg=CUDBrightGreen!50}
\setbeamercolor{CUDBrightCyan}{fg=black,bg=CUDBrightCyan}
\setbeamercolor{CUDCream}{fg=black,bg=CUDCream!75}

%\setbeamercolor{frametitle}{use=structure,fg=white,bg=structure.fg}
%\setbeamercolor{palette primary}{use=structure,fg=white,bg=structure.fg}
%\setbeamercolor{frametitle}{bg=CUDOrange}
%\setbeamercolor{palette primary}{bg=CUDOrange}
%\setbeamercolor{frametitle}{bg=CUDCyan!25,fg=black}
%\setbeamercolor{palette primary}{bg=CUDCyan!25,fg=black}
%\setbeamercolor{frametitle}{bg=CUDCream!75,fg=black!80}
%\setbeamercolor{palette primary}{bg=CUDCream!75,fg=black!80}

\newcommand{\myfrac}[2]{\mathchoice%■ 修正 Oct 8,2023
	{%\fontsize{20}{20}\selectfont%	\displaystyle
		\frac{\raisebox{-.6ex}{\(#1\)}}{\raisebox{.4ex}{\(#2\)}}}%
	{\textstyle{\frac{#1}{#2}}}%	\textstyle
	{%\fontsize{13}{13}\selectfont%	\scriptstyle
		\frac{\raisebox{0ex}{\(#1\)}}{\raisebox{-.4ex}{\(#2\)}}}%
	{%\fontsize{11}{11}\selectfont%	\scriptscriptstyle
		\frac{\raisebox{0ex}{\(#1\)}}{\raisebox{-.4ex}{\(#2\)}}}%
	}

\begin{document}

\title{プレ高数学科}\author{gbb60166}

\def\shikiplus{%
	\draw[->](-2.5,0)--(1,0);
	\draw[->](0,-0.5)--(0,3.5);
	\draw[CUDRed,domain=-2.2:0.2,samples=30] plot (\x,{2*(\x+1)^2+0.6});
	\draw[dashed](-1,0) node[below]{\scriptsize\( -\myfrac{\,a\,}{2}\)}
		--++(0,0.6)--++(1,0)
		node[right]{\scriptsize\( -\myfrac{\ a^2}{4}+2a \)};
	}
\def\shikiminus{%
	\draw[->](-2.5,0)--(1,0);
	\draw[->](0,-2)--(0,2);
	\draw[CUDRed,domain=-2.2:0.2,samples=30] plot (\x,{2*(\x+1)^2-1.2});
	\draw[dashed](-1,0) node[above]{\scriptsize\( -\myfrac{\,a\,}{2}\)}
		--++(0,-1.2)--++(1,0)
		node[right]{\scriptsize\( -\myfrac{\ a^2}{4}+2a \)};
	}
\def\shikiabs{%
	\draw[->](-2.5,0)--(1,0);
	\draw[->](0,-1)--(0,3);
	\draw[CUDRed,domain=-2.3:0.3,samples=30]
		plot (\x,{abs(2*(\x+1)^2-1.2)});
	\draw[dashed](-1,0) node[below]{\scriptsize\( -\myfrac{\,a\,}{2}\)}
		--++(0,1.2)--++(1,0)
		node[right]{\scriptsize\( \myfrac{\ a^2}{4}-2a \)};
	}

%■■■■■■■■■■■■■　テスト領域　■■■■■■■■■■■■■■


%\end{document}
%■■■■■■■■■■■■■　完成品　■■■■■■■■■■■■■■

\begin{frame}[t]
\frametitle{問題}
\centerline{\( \bigl|\, x^2+ax+2a \,\bigr|=a \)}

\bigskip
\centerline{（ただし$a$は正の実数）}

\vskip5ex
が異なる実数解を、ちょうど$2$個もつような$a$の値の範囲を求めなさい。
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{解答}
\( y= x^2+ax+2a \)とおくと
\( y= \Bigl( x+\myfrac{\,a\,}{2} \Bigr)^2 -\myfrac{\ a^2}{4}+2a \)と
なるので、グラフは

%\bigskip
\vfill
\quad
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=-6ex] current bounding box.north)}]
\shikiminus
\end{tikzpicture}
または \quad
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=-6ex] current bounding box.north)}]
\shikiplus
\end{tikzpicture}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\( |\, x^2+ax+2a \,|=a \)が異なる$2$個の実数解}
だから\( y= \bigl|\, x^2+ax+2a \,\bigr| \)のグラフは

\bigskip
\quad
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=-6ex] current bounding box.north)}]
\shikiabs
\end{tikzpicture}
または \quad
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=-6ex] current bounding box.north)}]
\shikiplus
\end{tikzpicture}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\( |\, x^2+ax+2a \,|=a \)が異なる$2$個の実数解}
問題に絶対値が付くので、頂点の$y$座標が\( <0,\quad >0,\quad =0 \)
で事情がかわるから場合分け！

\bigskip
\quad
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=-6ex] current bounding box.north)}]
\shikiminus
\end{tikzpicture}
または \quad
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=-6ex] current bounding box.north)}]
\shikiplus
\end{tikzpicture}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\ajKakkoroman{1}\quad\( -\,\myfrac{\ a^2}{4}+2a <0 \)のとき
	%分母の数字が切れるので見えない支柱を入れる
%	\rule[-0.5ex]{0pt}{0.3ex}
	\visible<2->{\textcolor{CUDYellow}{\( (\ a>8 \ ) \)}}
	}
\vspace*{-5.4ex}
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=3ex] current bounding box.north)}]
\shikiminus
\end{tikzpicture}
\begin{minipage}[t]{0.62\textwidth}
\begin{eqnarray*}
-\,\myfrac{\ a^2}{4}+2a &<& 0 \\
\myfrac{\ a^2}{4}-2a &>& 0 \\
a^2-8a &>& 0 \\
a\,(a-8) &>& 0 \\
a<0, \quad 8<a & &
\end{eqnarray*}
\end{minipage}

となるが、\pause
問題の条件に【\ $a$は正の実数\ 】と書かれている
ので\ \colorbox{CUDCream}{\( a>8 \)}\ となる。
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\ajKakkoroman{1}\quad\( -\,\myfrac{\ a^2}{4}+2a <0 \)のとき
	%分母の数字が切れるので見えない支柱を入れる
%	\rule[-12pt]{0pt}{3pt}
	\textcolor{CUDYellow}{\( (\ a>8 \ ) \)}
	}
\vskip-2ex
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=0ex] current bounding box.north)}]
%\draw[help lines] (-2,-1) grid (2,3);
%\useasboundingbox(-2,-1) rectangle (2,3);
\shikiabs
\visible<2->{\draw[CUDBlue](-2.5,1.8)--++(3,0)
	node[right,yshift=3pt]{\scriptsize\( y=a \)};
	}
\end{tikzpicture}
\begin{minipage}[t]{0.65\textwidth}
\smallskip
\only<1>{このとき\( y=| x^2+ax+2a | \)のグラフは図のようになる。}
\only<2>{\textcolor{CUDBlue}{\( y=a \)}との
	交点が$2$個になるには、左のようになればよい。
	}
\only<3->{よって\( \myfrac{\ a^2}{4}-2a < a \)ならOK}
\only<4->{\vspace*{-1ex}
	\begin{eqnarray*}
	a^2-8a &<& 4a \\
	a^2-12a &<& 0 \\
	a \,(a-12) &<& 0 \\
	0<a<12 & &
	\end{eqnarray*}
	}
\end{minipage}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\ajKakkoroman{1}\quad\( -\,\myfrac{\ a^2}{4}+2a <0 \)のとき
	%分母の数字が切れるので見えない支柱を入れる
%	\rule[-12pt]{0pt}{3pt}
	\textcolor{CUDYellow}{\( (\ a>8 \ ) \)}
	}
\colorbox{CUDCream}{\( a>8 \)}\quad
と\quad\textcolor{CUDBlue}{\( 0<a<12 \)}より

\vskip-2ex
\begin{tikzpicture}[>=stealth, very thick, inner sep=2pt,
	baseline={([yshift=2ex] current bounding box.north)}]
\fill[pattern color=CUDRed, pattern=north east lines]
	(8,0)--(8.5,1)--(11.5,1)--(12,0)--cycle;
\draw(2,0)--(13,0);
\draw(4,0)--(4.5,1)--(11.5,1)--(12,0);
\draw(8,0)--(8.75,1.5)--(13,1.5);
\filldraw[fill=white](4,0) circle (3pt)
	node[yshift=-2ex,fill=CUDCyan]{$0$};
\filldraw[fill=white](8,0) circle (3pt)
	node[yshift=-2ex,fill=CUDCream]{$8$};
\filldraw[fill=white](12,0) circle (3pt)
	node[yshift=-2ex,fill=CUDCyan]{$12$};
\end{tikzpicture}

\vskip2ex
\centerline{まとめると\quad\( 8<a<12 \)\quad ……\ajMaru{1}}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\ajKakkoroman{2}\quad\( -\,\myfrac{\ a^2}{4}+2a >0 \)のとき
	%分母の数字が切れるので見えない支柱を入れる
%	\rule[-12pt]{0pt}{3pt}
	\visible<2->{\textcolor{CUDYellow}{\( (\ 0<a<8 \ ) \)}}
	}
\vspace*{-2ex}
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=0ex] current bounding box.north)}]
\shikiplus
\visible<4->{\draw[CUDBlue](-2.5,1.8)--++(3,0)
	node[right]{\scriptsize\( y=a \)};
	}
\end{tikzpicture}
\begin{minipage}[t]{0.62\textwidth}
\smallskip
\only<1>{\vspace*{-2.4ex}
	\begin{eqnarray*}
	-\,\myfrac{\ a^2}{4}+2a &>& 0 \\
	\myfrac{\ a^2}{4}-2a &<& 0 \\
	a^2-8a &<& 0 \\
	a\,(a-8) &<& 0 \\
	\colorbox{CUDCream}{\( 0<a<8 \)} & &
	\end{eqnarray*}
	}
\only<3>{このとき\( y=| x^2+ax+2a | \)のグラフは図のようになる。}
\only<4>{だから\textcolor{CUDBlue}{\( y=a \)}との
	交点が$2$個になるには、左のようになればよい。
	}
\only<5->{よって\( -\,\myfrac{\ a^2}{4}+2a < a \)ならOK}
\only<6->{\vspace*{-2.4ex}
	\begin{eqnarray*}
	\myfrac{\ a^2}{4}-2a &>& -a \\
	a^2-8a &>& -4a \\
	a^2-4a &>& 0 \\
	a\,(a-4) &>& 0 \\
	a<0,\ 4<a & &
	\end{eqnarray*}
	}
\end{minipage}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\ajKakkoroman{2}\quad\( -\,\myfrac{\ a^2}{4}+2a >0 \)のとき
	%分母の数字が切れるので見えない支柱を入れる
%	\rule[-12pt]{0pt}{3pt}
	\textcolor{CUDYellow}{\( (\ 0<a<8 \ ) \)}
	}
\colorbox{CUDCream}{\( 0<a<8 \)}\quad
と\quad\textcolor{CUDBlue}{\( a<0,\ 4<a \)}より

\vskip-2ex
\begin{tikzpicture}[>=stealth, very thick, inner sep=2pt,
	baseline={([yshift=2ex] current bounding box.north)}]
\fill[pattern color=CUDRed, pattern=north east lines]
	(8,0)--(8.5,1)--(11.5,1)--(12,0)--cycle;
\draw(2,0)--(13,0)
	(4,0)--(4.5,1)--(11.5,1)--(12,0)
	(4,0)--(3.25,1.5)--(2,1.5)
	(8,0)--(8.75,1.5)--(13,1.5);
\fill(4,0) node[yshift=-2ex,fill=CUDBrightCyan,inner sep=5pt]{$0$};

\filldraw[fill=white](4,0) circle (3pt)
	node[yshift=-2ex,fill=CUDCream]{$0$};
\filldraw[fill=white](8,0) circle (3pt)
	node[yshift=-2ex,fill=CUDBrightCyan,inner sep=5pt]{$4$};
\filldraw[fill=white](12,0) circle (3pt)
	node[yshift=-2ex,fill=CUDCream]{$8$};
\end{tikzpicture}

\vskip2ex
\centerline{まとめると\quad\( 4<a<8 \)\quad ……\ajMaru{2}}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\ajKakkoroman{3}\quad\( -\,\myfrac{\ a^2}{4}+2a =0 \)のとき
	%分母の数字が切れるので見えない支柱を入れる
%	\rule[-12pt]{0pt}{3pt}
	\visible<2->{\textcolor{CUDYellow}{\( (\ a=8 \ ) \)}}
	}
\vspace*{-5ex}
\begin{eqnarray*}
-\,\myfrac{\ a^2}{4}+2a &=& 0 \\
a^2-8a &=& 0\\
a\,(a-8) &=& 0\\
a=0,\ 8 & &
\end{eqnarray*}

問題に【\ $a$は正の実数\ 】とかいてあるので\\
\( a=8 \)のときということになる。
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{\ajKakkoroman{3}\quad\( -\,\myfrac{\ a^2}{4}+2a =0 \)のとき
	%分母の数字が切れるので見えない支柱を入れる
%	\rule[-12pt]{0pt}{3pt}
	\textcolor{CUDYellow}{\( (\ a=8 \ ) \)}
	}
\vspace*{-4ex}
\begin{tikzpicture}[>=stealth, very thick,
	baseline={([yshift=2ex] current bounding box.north)}]
\draw[->](-2.5,0)--(1,0);
\draw[->](0,-0.5)--(0,3.5);
\draw[CUDRed,domain=-2.2:0.2,samples=30] plot (\x,{2*(\x+1)^2});
\draw[dashed](-1,0) node[below]{\scriptsize\( -4 \)};
\draw[CUDBlue](-2.5,1)--++(3,0)
	node[right,yshift=3pt]{\scriptsize\( y=8 \)};
\draw(0.5,2) node{\scriptsize\( 16 \)};
\end{tikzpicture}
\begin{minipage}[t]{0.62\textwidth}
\begin{eqnarray*}
y &=& \bigl|\, x^2+ax+2a \,\bigr|\\
y &=& \bigl|\, x^2+8x+16 \,\bigr|\\
y &=& \bigl|\, \hooklen{x^2+8x+16}{(x+4)^2} \,\bigr|\\
y &=& \hooklen{x^2+8x+16}{(x+4)^2}
\end{eqnarray*}
\end{minipage}

交点が$2$個になるので\\
\centerline{\( a=8 \)の場合もOK \quad ……\ajMaru{3}}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[t]
\frametitle{まとめると}
\hspace*{0.2\textwidth}
\ajKakkoroman{1}
\makebox[7em]{\( 8<a<12 \)}\quad ……\ajMaru{1}

\hspace*{0.2\textwidth}
\ajKakkoroman{2}
\makebox[7em]{\( 4<a<8 \)}\quad ……\ajMaru{2}

\hspace*{0.2\textwidth}
\ajKakkoroman{3}
\makebox[7em]{\( a=8 \)}\quad ……\ajMaru{3}

\bigskip
\ajMaru{1}\(,\)\ajMaru{2}\(,\)\ajMaru{3}を合わせて

\vskip2ex
\centerline{\□答\quad\( 4<a<12 \)}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




\end{document}
