[Question]
  [
In calculus, the derivative of a mathematical function defines the rate at which it changes. The derivative of a function `f(x)` can be marked as `f'(x)`, and these can sometimes be abbreviated to `f` and `f'`.
The derivative of the product of two functions `fg` is `f'g + g'f`. The derivative of three `fgh` is `f'gh + fg'h + fgh'`. In general, the derivative of a product of any number of functions is the sum of the product of all but one, multiplied by the derivative of the remaining one, for each individual function.
Your challenge is to take a string of distinct alphabetical characters and transform it into its derivative. No spacing or simplification is required, and terms separated by `+` may be in any order. The string will contain at least two characters.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code wins!
## Testcases
```
abc -> a'bc+ab'c+abc'
de -> d'e+de'
longabcdef -> l'ongabcdef+lo'ngabcdef+lon'gabcdef+long'abcdef+longa'bcdef+longab'cdef+longabc'def+longabcd'ef+longabcde'f+longabcdef'
short -> s'hort+sh'ort+sho'rt+shor't+short'
```
  
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 15 bytes
```
aRL#aJ'+<>#aJ''
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724ILNgwYKlpSVpuhbrE4N8lBO91LVt7ECUOkQUKrkiWikxKTlFKRbKBwA)
### Explanation
```
aRL#aJ'+<>#aJ''
a                Command-line arg       "abc"
   #a            Length of arg          3
 RL              Repeat-list            ["abc"; "abc"; "abc"]
     J'+         Join on "+"            "abc+abc+abc"
        <>#a     Groups of size len(a)  ["abc"; "+ab"; "c+a"; "bc"]
            J''  Join on "'"            "abc'+ab'c+a'bc"
```
[Answer]
# [Python](https://www.python.org), 54 bytes
```
lambda s:((l:=len(s))*(l*"'"+-~l*(s+"+")))[-~l*~l::-l]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY3zXISc5NSEhWKrTQ0cqxsc1LzNIo1NbU0crSU1JW0detytDSKtZW0lTQ1NaNBvLocKyvdnFiobqeCosy8Eo00DaVEoAouBC8JjZucgiGQmpaeARSEmLRgAYQGAA)
# [Python](https://www.python.org), 56 bytes
```
lambda s:((l:=-~len(s))*(l*(s+"+")+-~l*"'"))[l:-3*l:-~l]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY3LXISc5NSEhWKrTQ0cqxsdetyUvM0ijU1tTRytDSKtZW0lTS1gYJaSupKmprROVa6xlpAoi4nFqrfqaAoM69EI01DKRGogAvBS0LjJqdgCKSmpWcABSEmLVgAoQE)
## Old [Python](https://www.python.org), 58 bytes
```
lambda s:((l:=-~len(s))*(l*(s+"+")+l*"'"+"+"))[l:-3*l:-~l]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY3rXISc5NSEhWKrTQ0cqxsdetyUvM0ijU1tTRytDSKtZW0lTS1c7SU1JXATM3oHCtdYy0gUZcTCzXBqaAoM69EI01DKRGogAvBS0LjJqdgCKSmpWcABSEmLVgAoQE)
## How?
```
 a b c d +
(a)b c d +
 a(b)c d +
 a b(c)d +
 a b c(d)+
 ' ' ' '(')'
 a b c d(+)
 a b c d +
(a)b c d +
 a(b)c d +
 a b(c)d +
 ' ' '(')' '
 a b c(d)+
 a b c d(+)
 a b c d +
(a)b c d +
 a(b)c d +
 ' '(')' ' '
 a b(c)d +
   etc.
```
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~69~~ ~~64~~ 59 bytes
-10 thanks to @Noodle9 and @ceilingcat
```
l;f(char*a){for(l=0;a[l];)printf("+%.*s'%s"+!l,++l,a,a+l);}
```
[Try it online!](https://tio.run/##dcpBDoIwEIXhvbewCbFlinE/8STIYqwUSMaWdOqKcPYCe3m7l@93jWMKQymMXruRUk1m8TFpfj6QWu7QzGkK2WsF1b2WWyUKrmwB2JIlYINr@dIUtFkue0RvpwzOvyxavUJzbP@HfPoT4BiG3Et2JGeJjDHlf7aWDQ "C (clang) ‚Äì Try It Online")
[Answer]
# [Brainfuck](https://github.com/TryItOnline/brainfuck), ~~87~~ 84 bytes
```
>,>---[>+<+++++++]>++[>,]<[<]<[<]>[[.>]>.>[.[-<<+>>]>[.>]<[<]<++++.----[->+<]<[<]]>]
```
*Saved 3 bytes thanks to Nitrodon.*
[Try it online!](https://tio.run/##JYzBCcAwDAMHcuwJjBYRfiSBQin0Uej8bpwK9NAJaTz9vI93XploUFVCXH4FRIgWTt8GaQgYaFR3wQpFdl8D0zrQ9bBZIDL7mB8 "brainfuck ‚Äì Try It Online")
**Explanation**:
```
memory progress for abc:
null a null 'bc
null ab null 'c
null abc' null
string is split to two parts by null character
>,>                load first character
---[>+<+++++++]>++ load ' to memory; taken form esolangs wiki
[>,]               load rest of input
<[<]<[<]>          go to beginning of memory
[ 
 [.>]              print first part
 >.>               print '
 [                 check if there is text after '
  .                print first char of second part 
  [-<<+>>]         move char to the first part
  >[.>]            print rest of second part
  <[<]<            go to position of '
  ++++.----        use ' to print plus
  [->+<]           move '
  <[<]             go before beginning
 ]
 >                 move back to beginning
                   if there wasn't text after ' move after end instead
]
```
[Answer]
# [Python](https://www.python.org), 47 bytes
```
lambda s:"+".join(s.replace(c,c+"'")for c in s)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY39XMSc5NSEhWKrZS0lfSy8jPzNIr1ilILchKTUzWSdZK1ldSVNNPyixSSFTLzFIo1odqcCooy80o00jSUEpU0NbkQvCQ0bnIKhkBqWnoGUBBi0oIFEBoA)
How it works:
```
a  b  c  d --> a' b  c  d 
a  b  c  d --> a  b' c  d 
a  b  c  d --> a  b  c' d 
a  b  c  d --> a  b  c  d'
then join with '+'
```
[Answer]
# [Factor](https://factorcode.org/), 53 bytes
```
[ dup length [1,b] [ cut "'"glue ] with map "+"join ]
```
[Try it online!](https://tio.run/##RcyxCsIwGATgvU9xZHFQBFd9AHFxEafS4W/620TTJE3@UEF89prN7biPuwdpCWm93y7X8xGZ58Jec97zWxLlf4GJxOwT@bHmFyfPDjZgXnBqmnn5gHqNgeGCH4WzaMqMbEISfNcWQ4lwXMmgPez6Di10EaiNGl1hdFhspYki1FY9g/Xo6iom66WiDlMM9Y9Jm/UH "Factor ‚Äì Try It Online")
If the order of each product doesn't matter:
# [Factor](https://factorcode.org/), 43 bytes
```
[ all-rotations [ 39 suffix ] map "+"join ]
```
[Try it online!](https://tio.run/##RcwxDoJAEEbhnlP8oTXaWKEHMDY2xopQjOsgq8vOsjMEEuPZkc72y8tryZnk5XY9X04HKA8jR8e649ky6R/w5hw5wAuGCceiGKYP6O7wYASJT2M1R8rQTrLhu9SgELZZjMxLVNTYV9Cxbf2MBj0llJvyJT6iWduUfbTVnfRJ1guT65Yf "Factor ‚Äì Try It Online")
## Explanation
```
                  ! "short"
all-rotations     ! { "short" "horts" "ortsh" "rtsho" "tshor" }
[ 39 suffix ] map ! { "short'" "horts'" "ortsh'" "rtsho'" "tshor'" }
"+"join           ! "short'+horts'+ortsh'+rtsho'+tshor'"
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 46 44 bytes
```
l=>[...l].map(s=>l.replace(s,s+"'")).join`+`
```
[Try it online!](https://tio.run/##VZBta4QwDMff36cochCld@VuGwzm6j6IE9QaH26dFduNgfjZXas7dX2R/Jom/6S5Zd@ZFn3TmXOrCpxKPkkexYwxmbDPrPM1jyTrsZOZQF@fNPXACwJ2U02b0nQSqtWGGLSGk9jLcuGdiFegs1K1lQ0UWLqbrlVvvCQ8LCX406EwWCxlkAua5eCMgFkBkBY4o4RVh0oFO25hxxXs2AmubHU3FrBj22VjhB2Xc2sNbmiqa1icgsX1sDgD24dEjeID@/k/718Pz0/zJhxdH11WqXriSzSksSmX0LrXdQlMYluZOiSUNgEZDsQel@qW6nYbN1bgHkQbvBf@e9D2ofRNsETcVEoik6ry0@NgRnKOyHHQozV/s8aac45v15dLMqa2bJx@AQ "JavaScript (Node.js) ‚Äì Try It Online")
-2 bytes thanks to [emanresu A](https://codegolf.stackexchange.com/users/100664/emanresu-a)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jellylanguage), 14 bytes
```
J‚Äò≈ì·πñ‚Ç¨j‚Ç¨‚Äù'j‚Äù+‚Äù'
```
[Try It Online!](https://jht.hyper-neutrino.xyz/tio#WyIiLCJK4oCYxZPhuZbigqxq4oKs4oCdJ2rigJ0r4oCdJyIsIiIsIiIsWyJhYmMiXV0=)
```
J‚Äò≈ì·πñ‚Ç¨j‚Ç¨‚Äù'j‚Äù+‚Äù'  Full Program
J               [1, 2, ..., len]
 ‚Äò              [2, 3, ..., len + 1]
  ≈ì·πñ‚Ç¨           For each of these, partition (*)
     j‚Ç¨‚Äù'       Join each partition on ' (**)
         j‚Äù+    Join on +
            ‚Äù'  An unparseable nilad forces the current string to be printed
(And then the ' is printed at the end)
(*)  partition takes a list on the left but since we give it a single number,
     it auto-wraps it so we just get all needed splits
(**) the last partition only has one sublist so join doesn't work properly here
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), ~~15~~ 13 bytes
```
L$|+`.
$>`'$'
```
[Try it online!](https://tio.run/##K0otycxLNPz/30elRjtBj0vFLkFdRf3//8SkZAA "Retina ‚Äì Try It Online")
-2 thanks to Neil.
Match every character. For each one, take the text before the separator after the matched string, followed by an apostrophe, followed by the text after the matched string. Print as a list with separator `+`.
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 21 bytes
Most straightforward K solution.
```
{"+"/?[x;;"'"]'1+!#x}
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs6pW0lbSt4+usLZWUleKVTfUVlSuqOXiSlNKTFICkmnpGSCqOCO/qATEyMnPS09MSk5JTVPiAgDpMhDX)
### Explanation
```
{"+"/?[x;;"'"]'1+!#x}
     ?[x;;"'"]          / insert "'" in string at 
              '         / each position
               1+!#x    / 1..len of string
 "+"/                   / join the resulting strings with "+"
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~45~~ 36 bytes
```
aÔí°Riffle[a/.#->#<>"'"&/@a,"+"]<>""
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7P/H9pIVBmWlpOanRifp6yrp2yjZ2SupKavoOiTpK2kqxQJ7S/4CizLySaKBkmoNzRmJRYnJJalGxg3KsWl1wcmJeXTWXUmJSspIOl1JKKojMyc9LBwqkpKaBeMUZ@UUlSly1/wE "Wolfram Language (Mathematica) ‚Äì Try It Online")
Input `[{characters...}]`. Assumes all characters in input are unique. Returns a string.
---
### [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 35 bytes
```
ToString@Expand[Dt[1##]/._@a_:>a']&
```
[Try it online!](https://tio.run/##FYq9CsIwGAD3PEZS6qIWV8ESUHchbiGUr/lpCk0i6TcoYl89tsvBHRcAvQ2Ao4biqkt5JoF5jAO/v18QjbyhPDGmmmPHoTu3sFN1eawDSnZoXcW5@IQ@TQ2/esig0eaZM1UvQkNcvoRCr@meUGM3TikOazDWbTb7lJGSX/kD "Wolfram Language (Mathematica) ‚Äì Try It Online")
Input `[symbols...]`. Assumes symbols are unique and not defined. Returns a spaced string.
`Dt` treats strings as constants.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~83~~ \$\cdots\$ ~~72~~ 69 bytes
```
s=>g=(r="",i=0)=>s[i]?g(r+("+"+s).slice(!i,++i+1)+"'"+s.slice(i),i):r
```
[Try it online!](https://tio.run/##VZHhasMgEMe/7ymcFE4xLe02GDSzfZCu0NRcEjeJRd0YlDx7pkmXZn64@/n37jzPj@K78MrpS1i2tsS@kr2Xu1oyJynNtFxzufMHfdzXzAlGBRWer7zRCtmjzoTQYsMFhSjfVM0zzbeuV7b1gQSMRpIDLc6KZoSWmKyxbR2FEqu08411gR7zhzEFfy6oApZjGpyVKM6QjIKhAqAocUADUx1hLMy4hRnXMONUcOJY984KZhxvuTPCjKvhag@paeEbGJ2F0TkYXYD7g1SD6hPd8J73r6fXl2ESiTbPKaqyjjCDgegYss6je5uGsDLY1qHJSZw0J9cHElcKTUNNs40/k08iRvEv8d@BjwcVC5zxUUt9WYMrY2t2WlxDR5Y7srj6LppbtwcvpcT9Zrs@dqeY1vW/ "JavaScript (Node.js) ‚Äì Try It Online")
*Saved ~~7~~ 8 bytes thanks to [emanresu A](https://codegolf.stackexchange.com/users/100664/emanresu-a)!!!*  
*Saved 3 bytes thanks to [Samathingamajig](https://codegolf.stackexchange.com/users/98937/samathingamajig)!!!*
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 10 bytes
```
‚™´‚™™‚™´Ôº•Œ∏Œ∏+Ôº¨Œ∏'
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMMrPzNPI7ggJxPK9E0s0CjUUSjU1FFQ0lYCkj6peeklGRqFmiARdSVNTev//xOTkv/rluUAAA "Charcoal ‚Äì Try It Online") Link is to verbose version of code. Explanation: Port of @DLosc's Pip answer.
```
    Œ∏       Input string
   Ôº•        For each character
     Œ∏      Input string
  ‚™´         Join on
      +     Literal string `+`
 ‚™™          Split into substrings of length
        Œ∏   Input string
       Ôº¨    Length
‚™´           Join on
         '  Literal string `'`
            Implicitly print
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~14~~ 12 bytes
```
J''CL¬πJ'+SRL
```
[Try it online!](https://tio.run/##yygtzv7/30td3dnn0E4vde3gIJ/////n5OelJyYlp6SmAQA "Husk ‚Äì Try It Online")
Same approach as [DLosc's Pip answer](https://codegolf.stackexchange.com/a/247001/95126).
[Answer]
# [BQN](https://mlochbaum.github.io/BQN/), 21 bytes[SBCS](https://github.com/mlochbaum/BQN/blob/master/commentary/sbcs.bqn)
```
1‚Üì‚üú‚àæ'+'‚àæ¬®1‚Üì‚Üë‚àæ‚üú'''‚ä∏‚àæ¬®‚Üì
```
[Run online!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAgMeKGk+KfnOKIvicrJ+KIvsKoMeKGk+KGkeKIvuKfnCcnJ+KKuOKIvsKo4oaTCgpGICJhYmMi)
`‚Üë` gives prefixes, `‚Üì` suffixes. `‚àæ‚üú'''‚ä∏‚àæ¬®` joins matching prefixes and suffixes with a single quote.
`1‚Üì` removes the first value (empty prefix ‚àæ `'` ‚àæ full suffix).
`'+'‚àæ¬®` prepends a + to each string.
`1‚Üì‚üú‚àæ` joins the string and removes the leading +.
[Answer]
# [BQN](https://mlochbaum.github.io/BQN/), 28 bytes[SBCS](https://github.com/mlochbaum/BQN/blob/master/commentary/sbcs.bqn)
```
{1‚Üì‚•ä'''‚àæÀò‚ü®‚àò,‚â†ùï©‚ü©‚•ä¬´‚•ä'+'‚àæÀò‚ä¢‚åúÀúùï©}
```
[Run online!](https://mlochbaum.github.io/BQN/try.html#code=RuKGkHsx4oaT4qWKJycn4oi+y5jin6jiiJgs4omg8J2VqeKfqeKlisKr4qWKJysn4oi+y5jiiqLijJzLnPCdlal9CgpGICJsb25nYWJjZGVmIg==)
returns the required string with a trailing space. removing that is +3 bytes
-3 from ovs, who also made this [tacit](https://mlochbaum.github.io/BQN/try.html#code=RuKGkDHihpPin5zipYonJyfiiL7LmCgx4oC/MCviiaAp4qWK4p+cwqvin5zipYonKyfiiL7LmOKKouKMnMucCgojIG9yOiAx4oaT4p+c4qWKJycn4oi+y5go4p+o4oiY4p+p4oi+4omgKeKliuKfnMKr4p+c4qWKJysn4oi+y5jiiqLijJzLnAoKRiAibG9uZ2FiY2RlZiI=).
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 83 bytes
```
v=$1\';until [ $v = \'$1 ];do a+=+$v;v=$(sed "s/\(.\)'/'\1/"<<<$v);done;echo ${a#+}
```
[Try it online!](https://tio.run/##ZVFha4MwEP3eX3GkgVNC13Xsw4a6Dbr9CtMPMcYqK7FoKkLxt7tL22UbC5j37nzvuNwVqq/n6mS1a1oLVRTDeR4yvpGYnKxrDpADHyADiXwDu6RsQYlM8CEhUdSbEli/ltGdjHGNcrNmaZryISadNYnRdQv8rJZimqdFafRBdQZWCpzpXRYxVWgGrDR0HVq7p7A0FQV93XaOxb8dZjwa7Ux5daFQBWqh8FYARYl/q6AIHKvA0QSOZeCoA8cicFSB4z5wtIHjv5ZReEDnATsP2HrA/@/RtdGfpqPnyPHjQY7PW/oeqdAtfJfj05YsVdtBFEGT3SfQpIyfl9@TyN92E0tAiCb2414AHZeRwg835w39veSMzwXTT76n/VXAuG/s4iUbhT2DLCM0V9Wxa6y7yGD1Aryndd5az/nrbpKWLfyq5y8 "Bash ‚Äì Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 151 bytes
```
char*f(char*c,int i){char*r=malloc(i*i+i);char*o=r,k=0;for(;k<i*i;){if(k++%(i+1)==1)*o++='\'';*o++=*c++;if(!*c)c-=i,*o++='+';}*o--=0;*o='\'';return r;}
```
[Try it online!](https://tio.run/##VZBBboMwEEXXcAo6FcLGQwWJujLORRoWxEAYQXBlyApxdmqcqlI3nu83X@M/1tld633XfW3TjvmikaYlIr76m1WPehyNZpSSIC49NMrioHLZGcvkULqW5Ct1bBAiZiQKrlTBUyOESq5JIr1KtRDSed5SzXWmCF99kcgtNVnmprmx3m7b5WmnyMptf6dJj8@mjcp5aUa6ffSX8B8jc6Aj8KOmifE1DHzCaGnnZf6q1Ar1TQOeEZoW8IQwmunuUNN2gEWOMPfGLoCfCM5WIADmmwyDYzX/Dy4YlYU7hDrxMAi@rcMdg3iOsksUz9cJ8PUYVdixP/krRFFxLsNt/wE "C (gcc) ‚Äì Try It Online")
[Answer]
# [Julia](https://julialang.org), 40 bytes
```
a->join([replace(a,i=>"$i'") for i=a],+)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=LYsxDsIwEAR7v-JkIcUWTkVD43wEpTjiC1xknSPH4TM0aSKewFv4DUFhq9Xs7HMd5si4vB6YdaX9Ope-Pn8M1s2QWMwl0xixI4OOfaMPXGkLfcrAHlt3tH__9EMFWCAThshCk7EKtoyZpUQxxYEG34B2UCqrSMJ-Xd547VQgFZPcthqoV9M95bLPXw)
only works with all letters distinct
#### Why...how...what...
* `[... for i=a]` iterates over the string `a` and store the results in a list. `i` will be a `Char`
* `replace(a, i=>"$i'")` replaces all characters equal to `i` in `a` with `i` followed by `'`
* `join(..., +)` joins the list with `+`. `+` is a function, so `string(+) == "+"` is used.
[Answer]
# [R](https://www.r-project.org/), ~~81~~ 75 bytes
*Edit: -6 bytes thanks to Giuseppe*
```
function(x,`[`=substring)paste0(x[1,s<-1:nchar(x)],"'",x[s+1],collapse="+")
```
[Try it online!](https://tio.run/##TczBCsMgDADQf8llSjOo1zG/RApNbdoJEouxxb/vdtz5wav3yjVd1NLF/t5OiS0VMR3nMHs9F201yW4P0saj6cGhvp/uJfFD1XQ7ITwAe9DBTRhLznQoexjA/r0GcpGdlrjy9oMv "R ‚Äì Try It Online")
Takes advantage of the vectorization of `substring` over a vector of start (& optional end) positions, and the vectorization & argument-recycling of `paste` over vectors of strings to paste-together.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes
```
≈º\'v·πÄ\+j
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLFvFxcJ3bhuYBcXCtqIiwiIiwic2hvcnQiXQ==)
No clue why I didn't vectorise insertion back in May 2022.
## Explained
```
≈º∆õ?n\'·πÄ;\+j
≈º∆õ           # For each item P in the range 1...len(input):
  ?n         #   at position P in the input,
    \'·πÄ      #   insert a '
       ;     # end map
        \+j  # join the result of that on "+" and output
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 14 bytes
```
.
$`$&'$'+
.$
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wX49LJUFFTV1FXZtLT4Xr///EpGSulFSunPy8dCAzJTWNqzgjv6gEAA "Retina 0.8.2 ‚Äì Try It Online") Link includes test cases. Explanation:
```
.
$`$&'$'+
```
Replace each variable with its derivative multiplied by the other terms plus a trailing `+` to sum the products together.
```
.$
```
Delete the final trailing `+`.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
·πõ‚Ç¨j‚Äù+sLj‚Äù'
```
[Try it online!](https://tio.run/##y0rNyan8///hztmPmtZkPWqYq13sA6LU/z/cselwO1Aw8v//xKRkhZRUhZz8vHQgMyU1TaE4I7@oBAA "Jelly ‚Äì Try It Online")
Port of [DLosc's Pip solution.](https://codegolf.stackexchange.com/a/247001/85334)
```
 ‚Ç¨            For each element of the input,
·πõ             the input.
  j‚Äù+         Join the copies on +,
     sL       split into slices the length of the original input,
       j‚Äù'    and join those on '.
```
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
p‚Äù'$·πõ¬¶‚±ÆJj‚Äù+
```
[Try it online!](https://tio.run/##y0rNyan8/7/gUcNcdZWHO2cfWvZo4zqvLCBX@//DHZsOtz9qWhP5/39iUrJCSqpCTn5eOpCZkpqmUJyRX1QCAA "Jelly ‚Äì Try It Online")
The implementation of `¬¶` is a bit questionable, so we can just abuse Cartesian product to make up for it.
```
p‚Äù'            Pair each element of the input with ',
   $·πõ¬¶         and substitute elements of that into the input at
      ‚±ÆJ       each index, individually.
        j‚Äù+    Join the results on +.
```
Just for fun, without preserving the order within each term, `·π≠-∆§‚Äù'≈º@j‚Äù+` is 10.
[Answer]
# [PARI/GP](https://pari.math.u-bordeaux.fr), 58 bytes
```
s->j=strjoin;j([j(strsplit(s,c),Str(c"'"))|c<-Vec(s)],"+")
```
[Attempt This Online!](https://ato.pxeger.com/run?1=LYxBCsIwFESv8vkbE0z2orZLLyC4KUVqmtSEkob8uBC8iZuAiGfyNqbYzQxvmJnnJ3TRnoeQXwaq9y0ZufluSdauohTdZP3OscaxAhRGmxgJxcUxRaZwhZw_1F6etGLEW4Fr5MvDoQthvDMCWUOI1pcd4AwIpnS5gAa7i0IB2OtZx8kPJei1mYmuU0zYLm85__0H)
A port of [@att's Mathematica answer](https://codegolf.stackexchange.com/a/246988/9288).
Takes input as a string. Requires that all characters are unique.
---
## [PARI/GP](https://pari.math.u-bordeaux.fr), 64 bytes
```
v->i=1;j=strjoin;j([j([j(v[1..i]),j(v[i++..#v])],"'")|c<-v],"+")
```
[Attempt This Online!](https://ato.pxeger.com/run?1=LYxBCsIwFESvEr4L82kS6E6oLV7ArZsSJMa2ppQ2JDEgeBM3BRHP5G1sqzDMvLeZx9sqZ46NHZ81yV_XUPPNZxd5YfI0a3MfXDuYPmtpuSSWqRBGIpvRJIkQqyhRMlgD3vWWxwkTwP_PXlnb3agnvCDWmT5MCLMAqemh0tQjIiMlqJMGRuBczd0NfRMqH7Tyi_vL4ALI_-k4_vYL)
Take input as a list of characters.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 10 bytes
```
Œµ''¬´N«ù}'+√Ω
```
[Try it online!](https://tio.run/##yy9OTMpM/f//3FZ19UOr/Y7PrVXXPrz3//@c/Lz0xKTklNQ0AA "05AB1E ‚Äì Try It Online")
```
Œµ       map each character (of the implicit input string)
 ''     the ' character
 ¬´      append to the current character
 N      iteration index
 «ù      replace the input string's Nth character with the character with ' appended
}
'+      + character
√Ω       join by it
```
[Answer]
# [Raku](https://raku.org/), 33 bytes
This 33-byte version works on my local recent-ish version of Raku:
```
{join '+',.comb.map:{S/$^a/$a'/}}
```
But not on TIO, where a few more bytes are needed:
```
{join '+',.comb.map:{$^a;S/$a/$a'/}}
```
[Try it online!](https://tio.run/##DcZLDkAwFAXQrdxIowPCzMBvE@bkofWJelIm0nTtJTmDcyl7FMG8iDWa4HbeTshEptnEZswMXaUTPVVdLugnc@/DTS8iMaBp4TTE4CNotqhpnDArHHwuf2elca9snzZ8 "Perl 6 ‚Äì Try It Online")
* `.comb` breaks the input string up into characters.
* `.map: { S/$^a/$a'/ }` returns a copy of the input string for each character, in which that character has had an apostrophe appended to it.
* `join '+'` joins those strings together with a plus sign.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
¬¨¬£i''Y√Ñ√Éq+
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=rKNpJydZxMNxKw&input=ImFiYyI)
```
¬¨¬£i''Y√Ñ√Éq+     :Implicit input of string
¬¨              :Split
 ¬£             :Map each element at 0-based index Y
  i''          :  Insert a "'" in U at index
     Y√Ñ        :  Y+1
       √É       :End map
        q+     :Join with "+"
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 36 bytes
```
->s{s.chars.map{s.sub _1,'\&\''}*?+}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcsEiN9ulpSVpuhY3VXTtiquL9ZIzEouK9XITC4Ds4tIkhXhDHfUYtRh19Vote-1aiNp1BaUlxQpu0UqJSckpSrEQwQULIDQA)
[Answer]
# [J-uby](https://github.com/cyoce/J-uby), 52 bytes
```
~(:-&(:& &:sub|(~:%&(~:+&?')|:& &:*)|:|&A)).D|~:*&?+
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700K740qXLBIjfbpaUlaboWN03qNKx01TSs1BTUrIpLk2o06qxU1YCEtpq9umYNWFgLSNeoOWpq6rnU1FlpqdlrQ_SuKygtKVZwi1ZKTEpOUYqFCC5YAKEB)
[Answer]
# [Rust](https://www.rust-lang.org), 123 bytes
```
|s|{s.chars().map(|_|s).enumerate().map(|(i,w)|{let mut t=w.repeat(1);t.insert(i+1,'\'');t}).collect::<Vec<_>>().join("+")}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=dZG9bsIwFIXVMXkK46HXViCIreJv6SNU6lSJGueGpA0OtS9iSHiSLgztQ9GnqUMKpAMefD7bR0dH159fduvocJSpYWuVGyFZFQYFEkvGLDXi3pGVbDBnT2Rzs2Iz9r2ldPBwrGpXVy7WmbJOyHitNqJe1E7GaLZrtIrwfCvy_k7WVZO53hKj2S62uEFFYiQnFOfGoSWRR6M-vAD4q72MdVkUqGk8nj6jni7mcx_2Vvp6POJy31b4uXsNJmEwHLLHDPU7I3TEtHLowkC5JnSBHz2RCK6Wmss-4wqWOlJLaDYNXE7CkPn135zgyZsARgneMhWlWfmMBFNv5gVcjlFRQocNdHgFHW66XNhXurKGDvsaV0bocHqrm8tKS00tBw1FLoNWSmjFQit0Sgg2_mOpMD3Bqz3vs_O8_NPfoA-HVn8B)
]