{
  "index": "2024-A-2",
  "type": "ALG",
  "tag": [
    "ALG",
    "NT"
  ],
  "difficulty": "",
  "question": "For which real polynomials $p$ is there a real polynomial $q$ such that\n\\[\np(p(x)) - x = (p(x) - x)^2 q(x)\n\\]\nfor all real $x$?",
  "solution": "The answer is $p(x) = \\pm x+c$ for any $c \\in \\mathbb{R}$. Note that any such polynomial works: if $p(x)=x+c$ then $p(x)-x=c$, while if $p(x)=-x+c$ then $p(p(x))-x=0$.\nWe will show that in fact these are the only polynomials $p(x)$ such that $p(p(x))-x$ is divisible by $r(x)^2$, where $r(x)=p(x)-x$. \n\n\\noindent\n\\textbf{First solution.}\nSuppose that $p(p(x))-x$ is divisible by $r(x)^2$. Then\n\\begin{align*}\nx &\\equiv p(p(x)) \\\\\n&= p(x + r(x)) \\\\\n&\\equiv p(x) + p'(x) r(x) \\pmod{r(x)^2}.\n\\end{align*}\nIn other words, $r(x) (1 + p'(x))$ is divisible by $r(x)^2$.\nFrom this, it follows that either $r(x) = 0$ or $1+p'(x)$ is divisible by $r(x)$.\nIn the first case, we have $p(x) = x$.\nIn the second case, if $1 + p'(x) = 0$ then $p(x) = -x + c$ for some constant $c$;\notherwise, we have\n\\[\n\\deg(p) - 1 = \\deg(1 + p'(x)) \\geq \\deg(r)\n\\]\nand this is only possible if $p(x) = x + c$ for some constant $c$.\n\n\\noindent\n\\textbf{Second solution.}\nSuppose that $p(p(x))-x$ is divisible by $r(x)^2$. Then\n\\begin{align*}\n0 &\\equiv \\frac{d}{dx}(p(p(x)) - x) \\\\\n&= p'(x) p'(p(x)) - 1 \\\\\n&\\equiv p'(x)^2 -1 \\\\\n&= (p'(x) + 1)(p'(x) - 1) \\\\\n&= r'(x) (r'(x) + 2) \n\\pmod{r(x)}.\n\\end{align*}\nIf $\\alpha$ is a root of $r(x)$ of some multiplicity $m$, then the multiplicity of $\\alpha$ as a root of $r'(x)$ is $m-1$. Consequently, every root of $r(x)$ must be a root of $r'(x)+ 2$;\nin particular such a root cannot also be a root of $r'(x)$, so every root of $r(x)$ is simple.\nPutting this together, we deduce that $r(x)$ divides $r'(x) + 2$. If $r(x)$ is constant,\nthen $p(x) = x+c$ for some $c$. Otherwise, $\\deg(r'(x) + 2) < \\deg(r(x))$ and so $r'(x) + 2$ must be zero; then $r(x) = -2x + c$ for some $c$, whence $p(x) = -x + c$.",
  "vars": [
    "x",
    "p",
    "q",
    "r"
  ],
  "params": [
    "c",
    "\\\\alpha",
    "m"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "x": "varinput",
        "p": "polyfunc",
        "q": "quotient",
        "r": "residual",
        "c": "shiftval",
        "\\alpha": "rootalpha",
        "m": "multiplicity"
      },
      "question": "For which real polynomials polyfunc is there a real polynomial quotient such that\n\\[\npolyfunc(polyfunc(varinput)) - varinput = (polyfunc(varinput) - varinput)^2 quotient(varinput)\n\\]\nfor all real varinput?",
      "solution": "The answer is polyfunc(varinput) = \\pm varinput+shiftval for any shiftval \\in \\mathbb{R}. Note that any such polynomial works: if polyfunc(varinput)=varinput+shiftval then polyfunc(varinput)-varinput=shiftval, while if polyfunc(varinput)=-varinput+shiftval then polyfunc(polyfunc(varinput))-varinput=0.\nWe will show that in fact these are the only polynomials polyfunc(varinput) such that polyfunc(polyfunc(varinput))-varinput is divisible by residual(varinput)^2, where residual(varinput)=polyfunc(varinput)-varinput. \n\n\\noindent\n\\textbf{First solution.}\nSuppose that polyfunc(polyfunc(varinput))-varinput is divisible by residual(varinput)^2. Then\n\\begin{align*}\nvarinput &\\equiv polyfunc(polyfunc(varinput)) \\\\\n&= polyfunc(varinput + residual(varinput)) \\\\\n&\\equiv polyfunc(varinput) + polyfunc'(varinput) residual(varinput) \\pmod{residual(varinput)^2}.\n\\end{align*}\nIn other words, residual(varinput) (1 + polyfunc'(varinput)) is divisible by residual(varinput)^2.\nFrom this, it follows that either residual(varinput) = 0 or 1+polyfunc'(varinput) is divisible by residual(varinput).\nIn the first case, we have polyfunc(varinput) = varinput.\nIn the second case, if 1 + polyfunc'(varinput) = 0 then polyfunc(varinput) = -varinput + shiftval for some shiftval;\notherwise, we have\n\\[\n\\deg(polyfunc) - 1 = \\deg(1 + polyfunc'(varinput)) \\geq \\deg(residual)\n\\]\nand this is only possible if polyfunc(varinput) = varinput + shiftval for some shiftval.\n\n\\noindent\n\\textbf{Second solution.}\nSuppose that polyfunc(polyfunc(varinput))-varinput is divisible by residual(varinput)^2. Then\n\\begin{align*}\n0 &\\equiv \\frac{d}{dvarinput}(polyfunc(polyfunc(varinput)) - varinput) \\\\\n&= polyfunc'(varinput) polyfunc'(polyfunc(varinput)) - 1 \\\\\n&\\equiv polyfunc'(varinput)^2 -1 \\\\\n&= (polyfunc'(varinput) + 1)(polyfunc'(varinput) - 1) \\\\\n&= residual'(varinput) (residual'(varinput) + 2) \n\\pmod{residual(varinput)}.\n\\end{align*}\nIf rootalpha is a root of residual(varinput) of some multiplicity multiplicity, then the multiplicity of rootalpha as a root of residual'(varinput) is multiplicity-1. Consequently, every root of residual(varinput) must be a root of residual'(varinput)+ 2;\nin particular such a root cannot also be a root of residual'(varinput), so every root of residual(varinput) is simple.\nPutting this together, we deduce that residual(varinput) divides residual'(varinput) + 2. If residual(varinput) is constant,\nthen polyfunc(varinput) = varinput+shiftval for some shiftval. Otherwise, \\deg(residual'(varinput) + 2) < \\deg(residual(varinput)) and so residual'(varinput) + 2 must be zero; then residual(varinput) = -2varinput + shiftval for some shiftval, whence polyfunc(varinput) = -varinput + shiftval."
    },
    "descriptive_long_confusing": {
      "map": {
        "x": "candlestick",
        "p": "sunflower",
        "q": "lighthouse",
        "r": "hummingbird",
        "c": "cookbook",
        "\\alpha": "marzipan",
        "m": "rainstorm"
      },
      "question": "For which real polynomials $sunflower$ is there a real polynomial $lighthouse$ such that\n\\[\nsunflower(sunflower(candlestick)) - candlestick = (sunflower(candlestick) - candlestick)^2 lighthouse(candlestick)\n\\]\nfor all real $candlestick$?",
      "solution": "The answer is $sunflower(candlestick) = \\pm candlestick+cookbook$ for any $cookbook \\in \\mathbb{R}$. Note that any such polynomial works: if $sunflower(candlestick)=candlestick+cookbook$ then $sunflower(candlestick)-candlestick=cookbook$, while if $sunflower(candlestick)=-candlestick+cookbook$ then $sunflower(sunflower(candlestick))-candlestick=0$.\nWe will show that in fact these are the only polynomials $sunflower(candlestick)$ such that $sunflower(sunflower(candlestick))-candlestick$ is divisible by $hummingbird(candlestick)^2$, where $hummingbird(candlestick)=sunflower(candlestick)-candlestick$. \n\n\\noindent\n\\textbf{First solution.}\nSuppose that $sunflower(sunflower(candlestick))-candlestick$ is divisible by $hummingbird(candlestick)^2$. Then\n\\begin{align*}\ncandlestick &\\equiv sunflower(sunflower(candlestick)) \\\\\n&= sunflower(candlestick + hummingbird(candlestick)) \\\\\n&\\equiv sunflower(candlestick) + sunflower'(candlestick) hummingbird(candlestick) \\pmod{hummingbird(candlestick)^2}.\n\\end{align*}\nIn other words, $hummingbird(candlestick) (1 + sunflower'(candlestick))$ is divisible by $hummingbird(candlestick)^2$.\nFrom this, it follows that either $hummingbird(candlestick) = 0$ or $1+sunflower'(candlestick)$ is divisible by $hummingbird(candlestick)$.\nIn the first case, we have $sunflower(candlestick) = candlestick$.\nIn the second case, if $1 + sunflower'(candlestick) = 0$ then $sunflower(candlestick) = -candlestick + cookbook$ for some constant $cookbook$;\notherwise, we have\n\\[\n\\deg(sunflower) - 1 = \\deg(1 + sunflower'(candlestick)) \\geq \\deg(hummingbird)\n\\]\nand this is only possible if $sunflower(candlestick) = candlestick + cookbook$ for some constant $cookbook$.\n\n\\noindent\n\\textbf{Second solution.}\nSuppose that $sunflower(sunflower(candlestick))-candlestick$ is divisible by $hummingbird(candlestick)^2$. Then\n\\begin{align*}\n0 &\\equiv \\frac{d}{dcandlestick}(sunflower(sunflower(candlestick)) - candlestick) \\\\\n&= sunflower'(candlestick) sunflower'(sunflower(candlestick)) - 1 \\\\\n&\\equiv sunflower'(candlestick)^2 -1 \\\\\n&= (sunflower'(candlestick) + 1)(sunflower'(candlestick) - 1) \\\\\n&= hummingbird'(candlestick) (hummingbird'(candlestick) + 2) \n\\pmod{hummingbird(candlestick)}.\n\\end{align*}\nIf $marzipan$ is a root of $hummingbird(candlestick)$ of some multiplicity $rainstorm$, then the multiplicity of $marzipan$ as a root of $hummingbird'(candlestick)$ is $rainstorm-1$. Consequently, every root of $hummingbird(candlestick)$ must be a root of $hummingbird'(candlestick)+ 2$;\nin particular such a root cannot also be a root of $hummingbird'(candlestick)$, so every root of $hummingbird(candlestick)$ is simple.\nPutting this together, we deduce that $hummingbird(candlestick)$ divides $hummingbird'(candlestick) + 2$. If $hummingbird(candlestick)$ is constant,\nthen $sunflower(candlestick) = candlestick+cookbook$ for some $cookbook$. Otherwise, $\\deg(hummingbird'(candlestick) + 2) < \\deg(hummingbird(candlestick))$ and so $hummingbird'(candlestick) + 2$ must be zero; then $hummingbird(candlestick) = -2candlestick + cookbook$ for some $cookbook$, whence $sunflower(candlestick) = -candlestick + cookbook$. "
    },
    "descriptive_long_misleading": {
      "map": {
        "x": "knownvalue",
        "p": "constantmap",
        "q": "staticform",
        "r": "sumvalue",
        "c": "variable",
        "\\\\alpha": "nonrooted",
        "m": "unityonly"
      },
      "question": "For which real polynomials $constantmap$ is there a real polynomial $staticform$ such that\n\\[\nconstantmap(constantmap(knownvalue)) - knownvalue = (constantmap(knownvalue) - knownvalue)^2 staticform(knownvalue)\n\\]\nfor all real $knownvalue$?",
      "solution": "The answer is $constantmap(knownvalue) = \\pm knownvalue+variable$ for any $variable \\in \\mathbb{R}$. Note that any such polynomial works: if $constantmap(knownvalue)=knownvalue+variable$ then $constantmap(knownvalue)-knownvalue=variable$, while if $constantmap(knownvalue)=-knownvalue+variable$ then $constantmap(constantmap(knownvalue))-knownvalue=0$.\nWe will show that in fact these are the only polynomials $constantmap(knownvalue)$ such that $constantmap(constantmap(knownvalue))-knownvalue$ is divisible by $sumvalue(knownvalue)^2$, where $sumvalue(knownvalue)=constantmap(knownvalue)-knownvalue$. \n\n\\noindent\n\\textbf{First solution.}\nSuppose that $constantmap(constantmap(knownvalue))-knownvalue$ is divisible by $sumvalue(knownvalue)^2$. Then\n\\begin{align*}\nknownvalue &\\equiv constantmap(constantmap(knownvalue)) \\\\\n&= constantmap(knownvalue + sumvalue(knownvalue)) \\\\\n&\\equiv constantmap(knownvalue) + constantmap'(knownvalue) sumvalue(knownvalue) \\pmod{sumvalue(knownvalue)^2}.\n\\end{align*}\nIn other words, $sumvalue(knownvalue) (1 + constantmap'(knownvalue))$ is divisible by $sumvalue(knownvalue)^2$.\nFrom this, it follows that either $sumvalue(knownvalue) = 0$ or $1+constantmap'(knownvalue)$ is divisible by $sumvalue(knownvalue)$.\nIn the first case, we have $constantmap(knownvalue) = knownvalue$.\nIn the second case, if $1 + constantmap'(knownvalue) = 0$ then $constantmap(knownvalue) = -knownvalue + variable$ for some constant $variable$;\notherwise, we have\n\\[\n\\deg(constantmap) - 1 = \\deg(1 + constantmap'(knownvalue)) \\geq \\deg(sumvalue)\n\\]\nand this is only possible if $constantmap(knownvalue) = knownvalue + variable$ for some constant $variable$.\n\n\\noindent\n\\textbf{Second solution.}\nSuppose that $constantmap(constantmap(knownvalue))-knownvalue$ is divisible by $sumvalue(knownvalue)^2$. Then\n\\begin{align*}\n0 &\\equiv \\frac{d}{dknownvalue}(constantmap(constantmap(knownvalue)) - knownvalue) \\\\\n&= constantmap'(knownvalue) constantmap'(constantmap(knownvalue)) - 1 \\\\\n&\\equiv constantmap'(knownvalue)^2 -1 \\\\\n&= (constantmap'(knownvalue) + 1)(constantmap'(knownvalue) - 1) \\\\\n&= sumvalue'(knownvalue) (sumvalue'(knownvalue) + 2) \n\\pmod{sumvalue(knownvalue)}.\n\\end{align*}\nIf $nonrooted$ is a root of $sumvalue(knownvalue)$ of some multiplicity $unityonly$, then the multiplicity of $nonrooted$ as a root of $sumvalue'(knownvalue)$ is $unityonly-1$. Consequently, every root of $sumvalue(knownvalue)$ must be a root of $sumvalue'(knownvalue)+ 2$;\nin particular such a root cannot also be a root of $sumvalue'(knownvalue)$, so every root of $sumvalue(knownvalue)$ is simple.\nPutting this together, we deduce that $sumvalue(knownvalue)$ divides $sumvalue'(knownvalue) + 2$. If $sumvalue(knownvalue)$ is constant,\nthen $constantmap(knownvalue) = knownvalue+variable$ for some $variable$. Otherwise, $\\deg(sumvalue'(knownvalue) + 2) < \\deg(sumvalue(knownvalue))$ and so $sumvalue'(knownvalue) + 2$ must be zero; then $sumvalue(knownvalue) = -2knownvalue + variable$ for some $variable$, whence $constantmap(knownvalue) = -knownvalue + variable$. "
    },
    "garbled_string": {
      "map": {
        "x": "qzxwvtnp",
        "p": "hjgrksla",
        "q": "nvdalwqe",
        "r": "tczmpsio",
        "c": "wqjzhekt",
        "\\\\alpha": "vodkpmrq",
        "m": "cztbhnla"
      },
      "question": "For which real polynomials $hjgrksla$ is there a real polynomial $nvdalwqe$ such that\n\\[\nhjgrksla(hjgrksla(qzxwvtnp)) - qzxwvtnp = (hjgrksla(qzxwvtnp) - qzxwvtnp)^2 nvdalwqe(qzxwvtnp)\n\\]\nfor all real $qzxwvtnp$?",
      "solution": "The answer is $hjgrksla(qzxwvtnp) = \\pm qzxwvtnp+wqjzhekt$ for any $wqjzhekt \\in \\mathbb{R}$. Note that any such polynomial works: if $hjgrksla(qzxwvtnp)=qzxwvtnp+wqjzhekt$ then $hjgrksla(qzxwvtnp)-qzxwvtnp=wqjzhekt$, while if $hjgrksla(qzxwvtnp)=-qzxwvtnp+wqjzhekt$ then $hjgrksla(hjgrksla(qzxwvtnp))-qzxwvtnp=0$.\nWe will show that in fact these are the only polynomials $hjgrksla(qzxwvtnp)$ such that $hjgrksla(hjgrksla(qzxwvtnp))-qzxwvtnp$ is divisible by $tczmpsio(qzxwvtnp)^2$, where $tczmpsio(qzxwvtnp)=hjgrksla(qzxwvtnp)-qzxwvtnp$.\n\n\\noindent\n\\textbf{First solution.}\nSuppose that $hjgrksla(hjgrksla(qzxwvtnp))-qzxwvtnp$ is divisible by $tczmpsio(qzxwvtnp)^2$. Then\n\\begin{align*}\nqzxwvtnp &\\equiv hjgrksla(hjgrksla(qzxwvtnp)) \\\\\n&= hjgrksla(qzxwvtnp + tczmpsio(qzxwvtnp)) \\\\\n&\\equiv hjgrksla(qzxwvtnp) + hjgrksla'(qzxwvtnp) tczmpsio(qzxwvtnp) \\pmod{tczmpsio(qzxwvtnp)^2}.\n\\end{align*}\nIn other words, $tczmpsio(qzxwvtnp) (1 + hjgrksla'(qzxwvtnp))$ is divisible by $tczmpsio(qzxwvtnp)^2$.\nFrom this, it follows that either $tczmpsio(qzxwvtnp) = 0$ or $1+hjgrksla'(qzxwvtnp)$ is divisible by $tczmpsio(qzxwvtnp)$.\nIn the first case, we have $hjgrksla(qzxwvtnp) = qzxwvtnp$.\nIn the second case, if $1 + hjgrksla'(qzxwvtnp) = 0$ then $hjgrksla(qzxwvtnp) = -qzxwvtnp + wqjzhekt$ for some constant $wqjzhekt$;\notherwise, we have\n\\[\n\\deg(hjgrksla) - 1 = \\deg(1 + hjgrksla'(qzxwvtnp)) \\geq \\deg(tczmpsio)\n\\]\nand this is only possible if $hjgrksla(qzxwvtnp) = qzxwvtnp + wqjzhekt$ for some constant $wqjzhekt$.\n\n\\noindent\n\\textbf{Second solution.}\nSuppose that $hjgrksla(hjgrksla(qzxwvtnp))-qzxwvtnp$ is divisible by $tczmpsio(qzxwvtnp)^2$. Then\n\\begin{align*}\n0 &\\equiv \\frac{d}{dqzxwvtnp}(hjgrksla(hjgrksla(qzxwvtnp)) - qzxwvtnp) \\\\\n&= hjgrksla'(qzxwvtnp) hjgrksla'(hjgrksla(qzxwvtnp)) - 1 \\\\\n&\\equiv hjgrksla'(qzxwvtnp)^2 -1 \\\\\n&= (hjgrksla'(qzxwvtnp) + 1)(hjgrksla'(qzxwvtnp) - 1) \\\\\n&= tczmpsio'(qzxwvtnp) (tczmpsio'(qzxwvtnp) + 2) \n\\pmod{tczmpsio(qzxwvtnp)}.\n\\end{align*}\nIf $vodkpmrq$ is a root of $tczmpsio(qzxwvtnp)$ of some multiplicity $cztbhnla$, then the multiplicity of $vodkpmrq$ as a root of $tczmpsio'(qzxwvtnp)$ is $cztbhnla-1$. Consequently, every root of $tczmpsio(qzxwvtnp)$ must be a root of $tczmpsio'(qzxwvtnp)+ 2$;\nin particular such a root cannot also be a root of $tczmpsio'(qzxwvtnp)$, so every root of $tczmpsio(qzxwvtnp)$ is simple.\nPutting this together, we deduce that $tczmpsio(qzxwvtnp)$ divides $tczmpsio'(qzxwvtnp) + 2$. If $tczmpsio(qzxwvtnp)$ is constant,\nthen $hjgrksla(qzxwvtnp) = qzxwvtnp+wqjzhekt$ for some $wqjzhekt$. Otherwise, $\\deg(tczmpsio'(qzxwvtnp) + 2) < \\deg(tczmpsio(qzxwvtnp))$ and so $tczmpsio'(qzxwvtnp) + 2$ must be zero; then $tczmpsio(qzxwvtnp) = -2qzxwvtnp + wqjzhekt$ for some $wqjzhekt$, whence $hjgrksla(qzxwvtnp) = -qzxwvtnp + wqjzhekt$. "
    },
    "kernel_variant": {
      "question": "Let \\(p\\in\\mathbb{C}[x]\\) be a complex–coefficient polynomial.  Determine all such \\(p\\) for which there exists another complex polynomial \\(q\\) satisfying\n\\[\np\\bigl(p(x)\\bigr)-x\\;=\n\\bigl(p(x)-x\\bigr)^{\\mathbf 3}\\,q(x)\n\\qquad\\text{for every }x\\in\\mathbb{C}.\n\\]",
      "solution": "Let p∈ℂ[x] and set r(x)=p(x)−x.  We seek all p for which\n  p(p(x))−x  is divisible by  r(x)^3.\n\n1.  Degree considerations.  Write d=deg p.  If d=0 then p(x)=constant=k, so r(x)=k−x has degree 1 and p(p(x))−x=k−x=r(x), which is not divisible by r(x)^3 unless r≡0.  But r≡0 means k−x≡0, impossible.  Hence d≥1.\n\n2.  Taylor–expansion modulo r^3.  Since p(p(x))=p(x+r(x)), one has formally\n  p(p(x)) = p(x)+p'(x)r(x)+½ p''(x)r(x)^2 + O(r(x)^3).\nSubtracting x=(p(x)−r(x)) gives\n  p(p(x))−x = r(x)[1+p'(x)] + ½ p''(x)r(x)^2 + O(r(x)^3).\nIf this is divisible by r(x)^3, then the coefficients of r(x)^1 and r(x)^2 must themselves be divisible by r(x).  Equivalently,\n  r(x) | (1+p'(x)),\n  r(x) | p''(x).\n\n3.  If r is constant, then p(x)−x=c, so p(x)=x+c and obviously p(p(x))−x=2c=(p(x)−x)^3·q(x) with q(x)=2/c^2 (or arbitrary if c=0).  Thus p(x)=x+c is a solution.\n\n4.  If r is nonconstant then deg r=deg p=d.  From r∣[1+p'] we get\n  d = deg r ≤ deg(1+p') = deg p' = d−1,\n a contradiction unless 1+p'(x)≡0 identically.  Hence p'(x)=−1 and p(x)=−x+c.  In that case p(p(x))=x and so p(p(x))−x≡0, which is divisible by any power of r(x)=−2x+c; thus p(x)=−x+c also works.\n\n5.  Conclusion.  The only complex–coefficient solutions are\n  p(x)=x+c  or  p(x)=−x+c  (c∈ℂ),\nand one checks directly that each indeed makes p(p(x))−x a multiple of (p(x)−x)^3.",
      "_meta": {
        "core_steps": [
          "Let r(x)=p(x)−x so that r(x)^2 divides p(p(x))−x",
          "Use Taylor expansion: p(p(x))=p(x+r)≡p(x)+p'(x)r(x) (mod r(x)^2), hence p(p(x))−x≡r(x)(1+p'(x))",
          "Divisibility gives r(x)(1+p'(x)) divisible by r(x)^2 ⇒ either r(x)=0 or r(x) | 1+p'(x)",
          "If r(x)=0 then p(x)=x+c; if 1+p'(x)≡0 then p(x)=−x+c",
          "Otherwise degree comparison forces r(x) constant, again yielding p(x)=x+c"
        ],
        "mutable_slots": {
          "slot1": {
            "description": "Underlying coefficient field of the polynomials",
            "original": "real"
          },
          "slot2": {
            "description": "Exponent in the divisibility requirement (currently squared)",
            "original": "2"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}