# dashed lines in intersections and graph

I was trying to repeat this graph, but only a part of it. And my goal is to make the TP curve more downward at the end. In addition, I find difficult to make the dashed lines there. Is there a way to fix it?

Some equation that might work:

TP: Q=21x+9x^2-x^3 AP: Q=21+9x-x^2 MP: 21+18x-3x^2

Graph wanted:

Code:

  \documentclass{standalone}
\usepackage[english,greek]{babel}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage{tkz-tab}
\usepackage{cancel}
\usepackage{forest}
\usepackage{caption}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{pst-node}
\def\obj#1{\makebox[1cm]{\strut#1}}
\usepackage{pdflscape}
\usepackage{paralist}
\usepackage{pst-tree,array}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{rotating}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{chngcntr}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{wrapfig}
\usepackage{color}
\usepackage[explicit]{titlesec}
\usepackage{appendix}
\usepackage{etoolbox}
\usepackage{type1cm}
\usepackage{lettrine}
\usepackage[stable]{footmisc}
\usepackage{multicol}
\usepackage{chngcntr}
\usepackage{url}
\usepackage{marvosym}
\usepackage{tcolorbox}
\usepackage{hyperref}
\tcbuselibrary{theorems}
\usepackage{tkz-euclide}
\usetikzlibrary{shapes.geometric}
\usepackage{tkz-fct} \usetkzobj{all}
\usetikzlibrary{calc,decorations.pathreplacing}
\usetikzlibrary{decorations.markings}
\usepackage{pgfplots}
\usepackage{verbatim}
\usepackage{smartdiagram}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{intersections}

\begin{document}

\begin{tikzpicture}[scale=.8,>=latex,font=\footnotesize,domain=0:7]
\begin{scope}
\begin{scope}[yscale=-1,rotate=-90]
\draw[Red,thick,yscale=.25] plot (\x,{.2*\x^3-1.8*\x^2+6*\x})
node[above right]{$TP$};
\end{scope}
\begin{scope}[domain=1:6, rotate=0]
\draw[Green,thick,yscale=.6,name path global=MP] plot (\x,{-.6*\x^2+3.6*\x-1.5})
node[right]{$MP$};
\draw[Blue, thick,yscale=.6,name path global=AP] plot (\x,{-.2*\x^2+1.8*\x-.1})
node[right]{$AP$};
\end{scope}
\draw[very thick, <->](0,8)node[left]{$Q$}--(0,0)--(8,0)node[below]{$L$};
\end{scope}
\draw[name intersections={of=AP and MP, by=mypoint},dashed](mypoint)--(mypoint|-0,0);

\end{tikzpicture}
\end{document}

• You should remove the outmost scope, it has unnecessary [y shift=20cm]. Are the functions you used for TP, MP, and AP the same as the one used to get the desired figure? Or did you create your own functions to draw those curves? Your problem is closer to creating the correct form of the three functions than to TikZ. – Hoang-Ngan Nguyen Jul 9 '16 at 17:01
• How can the intersection move where AP=MP? Also, how can the TP line become like the one on the figure above (I mean at the end of it)? – Y_gr Jul 10 '16 at 21:03
• Please post compilable code. – cfr Jul 10 '16 at 21:33
• It seems that you haven't tikz problem but math problem: find appropriate function for your graph. From sketch follows that MP paths is derivative of TP paths and APmax lie on intersection of MP and AP. So, probably you miss the right forum for your problem ... – Zarko Jul 17 '16 at 16:18