text:
I'm a palindrome. Are you?

There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair competition under our modern rulesets.

Background
A palindrome is a string that "reads the same forwards and backwards", i.e. the reverse of the string is the same as the string itself. We're not talking about "convenient palindromes" here, but a strict character-by-character reversal; for example, ()() is not a palindrome, but ())( is.
The task
Write a program or function that takes a string S (or the appropriate equivalent in your language) as input, and has one output Q (of a type of your choice). You can use any reasonable means to take the input and provide the output.

When the input S is a palindrome, the output Q should have a value A (that is the same for any palindromic S).
When the input S is not a palindrome, the output Q should have a value B (that is the same for any non-palindromic S).
A and B must be distinct from each other.

Or in other words: map all palindromes to one value, and all non-palindromes to another.
Additionally, the program or function you write must be a palindrome itself (i.e. its source code must be palindromic), making this a restricted-source challenge.
Clarifications

Although true and false are obvious choices for A and B, you can use any two distinct values for your "is a palindrome" and "isn't a palindrome" outputs, which need not be booleans.
We're defining string reversal at the character level here; éé is palindromic regardless of whether the program is encoded in UTF-8 or Latin-1, even though it's not a palindromic sequence of octets after UTF-8 encoding.
However, even if your program contains non-ASCII characters, it only needs to work for ASCII input. Specifically, the input S will only contain printable ASCII characters (including space, but not including newline). Among other things, this means that if you treat the input as a sequence of bytes rather than a sequence of characters, your program will still likely comply with the specification (unless your language's I/O encoding is very weird). As such, the definition of a palindrome in the previous bullet only really matters when checking that the program has a correct form.
Hiding half the program in a comment or string literal, while being uncreative, is legal; you're being scored on length, not creativity, so feel free to use "boring" methods to ensure your program is a palindrome. Of course, because you're being scored on length, parts of your program that don't do anything are going to worsen your score, so being able to use both halves of your program is likely going to be helpful if you can manage it.
Because the victory criterion is measured in bytes, you'll need to specify the encoding in which your program is written to be able to score it (although in many cases it will be obvious which encoding you're using).

Victory criterion
Even though the program needs to be a palindrome at the character level, we're using bytes to see who wins. Specifically, the shorter your program is, measured in bytes, the better; this is a code-golf challenge. In order to allow submissions (especially submissions in the same language) to be compared, place a byte count for your program in the header of your submission (plus a character count, if it differs from the number of bytes).

Would someone please explain why would ()() not be a palindrome??

@EmilioMBumachar Try replacing ( with a and ) with b.  Is abab a palindrome? No, it would have to be abba. Then ()() isn't a palindrome either; it would have to be ())(.

Those solutions entirely using comments to make the program palindromic looks like a loophole to me :(

@kennytm The OP himself allows it.

Can I give no output if S is not a palindrome and print 1 if it is?

@kennytm Disallowing them would be worse, because there's no satisfactory way to do that objectively in a language-agnostic way. (What's a comment? What about putting the unused half in a string literal that is discarded? What about 2D languages where you can have perfectly executable code that is simply never reached?)

I think another interesting result of this could be the longest program in which every bit of code is executed. I.E., there are no comments or sections of code that are never reached just to make it a palindrome.

@EngineerToast: We've had a few challenges along those lines. The solution nearly always ends up to be putting most of the program in a string literal, and then using some sort of checksum to ensure that it actually has an effect on the program, which probably isn't what you were expecting.

I had to join this stack just to leave a comment and up-vote here.  It boggles the mind how you guys come up with these challenges that look complex yet get solved in 3 bytes in a bunch languages, even regular ones.

()() is not a palindrome, but ())( is.
Congratulations, you made it onto reddit!

This one popped back up to the top of the stack and I have to ask, is éé a palindrome? (Fair warning, it is not strictly equal to éé). Reversed by unicode character endpoints, it would be ́ée.

Can S be the empty string ""?

Brachylog (2), 3 bytes in Brachylog's codepage
I↔I

Try it online!
This is a full program that takes input via standard input (using Brachylog's syntax for constants, i.e. strings are enclosed in double quotes), and outputs via standard output. The outputs are true. for a palindromic input, and false. for a non-palindromic input.
Not only is this program palindromic, it also has left/right (and probably in some fonts up/down) mirror symmetry.
Explanation
In Brachylog, capital letters mark points in the program which have identical values; this is used almost like an electrical circuit to carry information from one part of the program to another. One consequence of this is that if you enclose a command between an identical pair of capital letters, you're effectively asserting that the command's input and output are the same. Brachylog implicitly takes input, so in this case we're also asserting that the input to the command is the same as the input to the program. In this program, we're using the command ↔, which reverses things (in this case, strings); so the program effectively asserts that the input is the same forwards and backwards.
A full program (as opposed to a function) in Brachylog returns a boolean, false. if there's no way to make all the assertions in the program correct at once, or true. if the assertions in the program are all compatible with each other. We only have one assertion here – that reversing the input does not change it – so the program acts as a palindrome checker.

And 180 degree rotational symmetry, It's beautiful.

... and symmetry along vertical and horizontal axes :-)

More like 5 bytes in UTF-8, isn't it?

@SteakOverflow Brachylog uses a custom code-page, so those characters are not encoded in UTF-8

I joined this community just to up vote this program. Wow.

@ATaco The combination of left/right and up/down symmetries imply 180 degree rotational symmetry. ;)

This is the best program of all time!

Pyth, 3 bytes
_I_

Returns True or False.
Try it online!
How it works
  _  Reverse the input.
_I   Invariant-reverse; test if the reversed input is equal to its reverse.

Why do you need the final _?

@busukxuan From the question, "Additionally, the program or function you write must be a palindrome itself"

Why so many upvotes...This answer doesn't seem that hard to come up with...?

@ghosts_in_the_code The vast majority of answers to this challenge weren't difficult to come up with...

I guess so. Still it seems kind of unfair. On some questions, one must put a lot of hard work to answer, and others are much easier. Still the payout is the same. Btw I've also upvoted :P

@ghosts_in_the_code Only one of my answers with 100+ was actually challenging to write, yet there are answers I spent days on that only got a handful of upvotes. In the end, it all evens out...

Python, 39 bytes
lambda s:s[::-1]==s#s==]1-::[s:s adbmal

Try it online!
Boring, but if there is shorter in Python it will be impressive.

Wow, thos (, ) were some good (and confusing) inputs :)

Jelly, 5 bytes
ḂŒ
ŒḂ

Returns 1 or 0. The first line is an unexecuted helper link, the second line calls the palindrome test.
Try it online!

wow, recent addition.

Yep, only 18 hours old.

you didn't specify the encoding. I'm guessing UTF-8?

@BrianMinton No, this would be 11 bytes in UTF-8. Jelly uses this code page.

@Dennis, thanks for the info.

Jelly, 5 bytes
⁼ṚaṚ⁼

Try it online!
Equals reverse and reverse equals.
Or the more efficient yet less aesthetically pleasing:
⁼Ṛ
Ṛ⁼

or
Ṛ⁼
⁼Ṛ

Haskell, 87 85 44 34 bytes
p=(==)<*>reverse--esrever>*<)==(=p

Explanation: ((->) a) is an instance of Applicative (thanks @faubiguy), with <*> defined as
(<*>) f g x = f x (g x)

So by substituting in the arguments one can see why this works.

Can you explain the code?

@bli everything after the -- is a comment.

@theonlygusti Haskell is sufficiently alien that that only half helps.

@Yakk It's some sort of combination of the (==), reverse, and id functions (id is the identity function).

You can save 10 bytes by using <*> instead of <$> and removing the <*>id

Nice thinking! Applicative is still weird to me...

f=reverse>>=(==) works too for the same reasoning and the Monad ((->) r) instance which looks like f >>= g = \x -> g (f x) x and is essentially flipping the arguments of the combining function

05AB1E, 3 bytes
Code:
ÂQÂ

Explanation:
Â     # Bifurcate (duplicate and reverse the duplicate) implicit input
 Q    # Check if equal
  Â   # Bifurcate the result

Uses the CP-1252 encoding. Try it online!

Why not just ÂQ

@NeilA. The code itself needs to be a palindrome as well.

Mathematica, 23 bytes
QemordnilaP;PalindromeQ

Not very interesting, but for the sake of completeness...
The above is a CompoundExpression which evaluates to PalindromeQ, a built-in that solves the challenge. QemordnilaP is simply an undefined identifier, which is ignored because of the ;.

PHP, 55 bytes
<?=strrev($s=$argv[1])==$s;#;s$==)]s[TEG_$=s$(verrts=?<

Try it online!

Sneaky solution.

MATL, 7 bytes
tPX=XPt

Try it online!
Returns [1; 1] for palindromic input and [0; 0] otherwise.
t       % duplicate the input
P       % reverse the second string
X=      % check the two strings are exactly equal (returns 0 or 1)
XP      % flip array (does nothing)
t       % duplicate the answer, giving either [1;1] or [0;0]
        % (implicit) convert to string and display

Pip, 12 11 bytes
Now comment-free!
x:RVaQaVR:x

Takes input as a command-line argument; outputs 1 for palindrome, 0 for non-palindrome. Try it online!
The core of what we want to do is RVaQa: reverse(a) string-equals a. The code x:RVaQa calculates this result and assigns it to x. Then VR:x assigns the value of x to the variable VR. Since this assignment is the last statement in the program, its value is also autoprinted. Voila!
For a previous interesting version using some undefined behavior, see the revision history.

Perl 6, 25 bytes/chars utf8
{.flip eq$_}#}_$qe pilf.{

Try it

GNU sed, 64 59 + 1(r flag) = 60 bytes UTF-8
Took me a while to come up with a sed answer that is not using a comment section to make the code a palindrome. Instead, I use the c command that would print the first half of the code in reverse order, only I make sure this instruction is not reached.
:;s:^(.)(.*)\1$:\2:;t;/../c1
d
1c/../;t;:2\:$1\)*.().(^:s;:

The script prints 1 if the input string is not a palindrome (think of it as giving an error). If the string is a palindrome, then no output is given (think of it as exiting successfully).
Run examples: or Try it online!
me@LCARS:/PPCG$ sed -rf palindrome_source.sed <<< "level"
me@LCARS:/PPCG$ sed -rf palindrome_source.sed <<< "game"
1

Explanation:
:                              # start loop
s:^(.)(.*)\1$:\2:              # delete first and last char, if they are the same
t                              # repeat if 's' was successful
/../c1                         # if at least 2 chars are left, print 1. 'c' reads
                               #till EOL, so next command must be on a new line.
d                              # delete pattern space. This line must be a
                               #palindrome itself, and must end the script.
1c/../;t;:2\:$1\)*.().(^:s;:   # (skipped) print first half of code in reverse
                               #order. Everything after 'c' is treated as string.

TIO has support for sed now. -r doesn't work, but you can just wrap the whole thing in BASH. Try it Online!

@Riley Nice usage of header and footer on TIO, thanks. The previous workaround was to move the code to the argument list with -e, but your way is much nicer. I was waiting for that to be fixed, but this way I don't need to.

Nice answer.  I think you can -2 changing /../ to /./: Try it online!

R, 111 103 bytes
all((s<-el(strsplit(scan(,"",,,"\n"),"")))==rev(s))#))s(ver==)))"",)"n\",,,"",(nacs(tilpsrts(le-<s((lla

Not the most original answer. # is the comment character in R
Ungolfed:
all((s<-el(strsplit(scan(,"",,,"\n"),"")))==rev(s))
#
))s(ver==)))"",)"n\",,,"",(nacs(tilpsrts(le-<s((lla

The character string from scan is converted into raw bytes thanks to the charToRaw function. These raw bytes are compared one-by-one to their counterparts from the rev() function, which reverses the order of its argument. The output of this part is a vector of TRUE and/or FALSE.
The all function then outputs TRUE if all those elements are TRUE
Here, "\n" in the scan function is necessary for inputs with more than one word.
Previous answer (byte-wise), 81 bytes
function(s)all((s=charToRaw(s))==rev(s))#))s(ver==))s(waRoTrahc=s((lla)s(noitcnuf

with - 24 bytes thanks to @rturnbull.

You can save a good few bytes by doing the charToRaw conversion before assignment to s, and changing how you set the sep argument to scan: all((s<-charToRaw(scan(,"",,,"\n")))==rev(s))#))s(ver==)))"n\",,,"",(nacs(waRoTrahc-<s((lla

(Also, this approach doesn't work for e.g. input éé under a UTF-8 encoding, but I don't think that breaks the rules of the challenge.)

@rturnbull : thanks for the inputs ! I indeed tested éé with a latin1 encoding.

Since the test must be done character-wise, I think the current programm breaks the rules.

I'm not so sure the previous version does break the rules. OP states: "Among other things, this means that if you treat the input as a sequence of bytes rather than a sequence of characters, your program will still likely comply with the specification (unless your language's I/O encoding is very weird)."

But if you insist on the new version, you can replace s<-unlist( with s=el( to save a few bytes.

A further improvement on the byte-comparison method: an anonymous function for 81 bytes function(s)all((s=charToRaw(s))==rev(s))#))s(ver==))s(waRoTrahc=s((lla)s(noitcnuf

@rturnbull : It's the "We're defining string reversal at the character level here; éé is palindromic regardless of whether the program is encoded in UTF-8 or Latin-1" part that made me doubt. Nice function too !

@count : It does work as is, but since nothing is said about lower/uppercase, you could drop this part. strsplit(x)[[1]] can be replace by el(strsplit(x)). You end up with a 56 bytes function(x)paste(rev(el(strsplit(x,""))),collapse="")==x anonymous function. In the palindromic-ing process, you gain 57 bytes. Nice inputs though !

This isn't a palindrome, the parenthesis are wrong.

utf8ToInt is shorter than strsplit. It'll work for all ASCII: try it online

RProgN, 11 bytes
~]S.E E.S]~

The first half of this does all the heavy lifting, and by a convenience of RProgN, the second half is a No-op.
~]S.E E.S]~
~           # Treat the word as a Zero Space Segment
 ]          # Duplicate the top of the stack
  S.        # Reverse the top of the stack
    E       # Compare if these values are equal
      E.S]~ # A no-op, because the ~ is at the end of the word, not the start.

Try it online!

Alice, 19 bytes
/@.nzRoi\
\ioRzn.@/

Try it online!
Prints Jabberwocky for palindromes and nothing for non-palindromes. Works for arbitrary UTF-8 input.
Explanation
Since this is a string processing task, Alice will have to operate in Ordinal mode to solve it. That in turn means that the instruction pointer has to move diagonally, and therefore we need at least two lines so that the IP can bounce up and down. The linefeed in such a program makes for a good position to place the middle character of the palindrome. That means the second line needs to be the reverse of the first. But since we're only executing every other character on each line, if we make sure that the line-length is odd, the reverse of the code will neatly fit into its own gaps. The only character that isn't used at all is the backslash, but since it was arbitrary I chose it to make the program look nice and symmetric.
So anyway, the actual relevant code is this:
/ . z o
 i R n @

Which is executed in a zigzag from left to right.
/   Reflect the IP southeast, enter Ordinal mode.
i   Read all input as a single string.
.   Duplicate the input.
R   Reverse the copy.
z   Pop the reverse Y and the original X. If X contains Y, drop everything
    up to its first occurrence. Since we know that X and Y are the same length,
    Y can only be contained in X if X=Y, which means that X is a palindrome.
    So this will result in an empty string for palindromes and in the non-empty
    input for non-palindromes.
n   Logical NOT. Replaces non-empty strings with "", and empty strings with
    "Jabberwocky", the "default" truthy string.
o   Output the result.
@   Terminate the program.

Retina, 53 bytes
Byte count assumes ISO 8859-1 encoding.
$
¶$`
O$^`\G.
»
D`
M$`^.+$
$+.^`$M
`D
»
.G\`^$O
`$¶
$

Try it online!
I'm pretty sure this isn't optimal yet (the » line seems particularly wasteful, and I have a 45-byte solution that is palindromic except for one character), but I guess it's a start.

Haskell, 34 bytes
f=(==)=<<reverse--esrever<<=)==(=f

Try it online! Call with f "some string", returns True or False.
The =<< operator on functions works like f=<<g = \s -> f (g s) s, so the code is equivalent to f s=s==reverse s, which, as I just noticed, would result in the same byte count.

Version without comment: (49 bytes)
e x y=x/=y
p=e=<<reverse
esrever<<=e=p
y=/x=y x e

Try it online!
Call with p "some string". This outputs False if the given string is a palindrome, and True if it's not a palindrome.
Explanation:
I found this comment free palindrome by starting with the comment version and replacing the the comment with a new line:
p=(==)=<<reverse
esrever<<=)==(=p

The second line fails because the parenthesis do not match, so we need to get rid of them. If we had a function e which checks for equality, then
p=e=<<reverse
esrever<<=e=p

will both compile with the second line defining an infix-operator <<= which takes two arguments esrever and e and returns the function p.
To define e as the equality function one would normally write e=(==), but )==(=e will again not compile. Instead we could explicitly take two arguments and pass them to ==: e x y=x==y. Now the reversed code y==x=y x e compiles but redefines the == operator, which causes the definition e x y=x==y to fail. However if we switch to the inequality operator /=, the reversed definition becomes y=/x=y x e and defines a =/ operator which does not interferes with the original /= operator.

OIL, 178 bytes
Reads an input, explodes it, slowly adds its length (through incrementing and decrementing) to the address to know to the address after the string, jumps to a different part of code (in the middle), reverses the band direction, implodes the string again, and checks whether it's the same as the original string. TL;DR: It's a pain, as usual.
Outputs 40 if the string isn't a palindrome, 0 if it is.
5
0
12
0
40
1
40
2
1
40
34
10
2
3
22
16
9
2
8
35
6
11
6
37

3
4
4
27
26
0
1
10
1

40
13
2
31
04

1
01
1
0
62
72
4
4
3

73
6
11
6
53
8
2
9
61
22
3
2
01
43
04
1
2
04
1
04
0
21
0
5

Neat language! :)

Japt, 7 2 bytes
êê

Run it
Old solution:
U¥UwU¥U

Try it online!
Explanation
U¥UwU¥U
U¥        U is the input, ¥ is a shortcut for ==
  Uw      w is a reverse function.
    U¥U   This calculates U == U (always true), but the result is ignored
          because w does not look at its arguments.

Japt doesn't escape functions unless a closing parenthesis (or space) is reached.
This can be re-written: U¥Uw(U¥U)→U¥Uw→U==Uw. In Japt, the parenthesis left out at the begining and end of a function is auto-inserted.

It all makes sense, except if w is a function that takes no arguments, how does it apply to U? Is it something like U.reverse()?

@DLosc Correct. It reverses U in the same way as U.reverse().

Java 8, 92 90 bytes
This is a comment version. If a string contains its reverse, then it is a palindrome (true) otherwise it is not (false).
s->s.contains(new StringBuffer(s).reverse())//))(esrever.)s(reffuBgnirtS wen(sniatnoc.s>-s

Try it online!
Update

-2 [18-04-05] Switched to contains. Thanks to @Kevin Cruijssen!
-2 [17-02-20] Removed ;'s
-16 [17-02-22] Auto convert

This code is not a lambda expression.

@Jakob I thought it was. If you were to use the lambda, you would probably want a leading and trailing newline. (I added a tio link)

Yeah, my complaint was that the line comment makes the submission more than just a lambda expression, and thus not valid as a lambda solution. Don't worry about it for now; I'll probably eventually make a meta post to gather consensus.

@Jakob Lambda solutions can sometimes have extraneous code, which is why I think it is valid. But if you aren't sold, a meta post wouldn't hurt.

Well, the post you reference addresses multiple lambda expressions in a single solution, not code outside the expressions themselves (the author's intent in the last part is just to make function g available to x, not to allow extra code). At least that's the way I see it.

I know it's been a while, but you can golf 2 bytes by changing it to s->s.contains(new StringBuffer(s).reverse())//))(esrever.)s(reffuBgnirtS wen(sniatnoc.s>-s. Try it online 90 bytes.

Dyalog APL, 6 bytes
⌽≡⊢⊢≡⌽

Try it online!

This is the "correct" answer (as it works on all arrays), but for this particular challenge specification (argument is always a string), ⌷≡⌽⌽≡⌷ or +≡⌽⌽≡+ works too while also being visually palindromic.

J, 9 bytes
[:-.|.-:[
Attempt This Online!
Lolwut. I was fiddling with various arrangements and adverb trains until I realized [: in trains is a thing, and -. (boolean negation) is perfectly OK thanks to the permissive output format. Returns 0 if the input is palindrome and 1 otherwise.
[: -. (|. -: [)
       |. -: [   Reverse matches identity (classic palindrome check)
[: -.            Boolean negation on the result

J, 11 bytes
]&.|:-:|.&]
Attempt This Online!
Wins against the existing comment abuse solution. Uses a similar trick to this answer to "I reverse the source, you reverse the input!".
Many of J's built-ins have inflections . and :, which are always treated as the suffix of a larger token. So the function above tokenizes as ] &. |: -: |. & ]. And &. and & are conjunctions, which consume two things on both sides to form a single verb. Finally, verb1 verb2 verb3 is a verb train; when given an argument y, it evaluates to (verb1 y) verb2 (verb3 y).
] &. |: -: |. & ]
] &. |:             Identity under transpose: returns the input unchanged
           |. & ]   Reverse over identity: returns the input reversed
        -:          Match: tests if the two sides are identical

This is beautiful

Javascript, 64 bytes
f=s=>s==[...s].reverse().join``//``nioj.)(esrever.]s...[==s>=s=f

Call function f with string
f("abba") // returns true
f("abab") // returns false

Your source code is not a palindrome!

@seshoumara Updated the code

Now it's fine. Maybe mention the return value if the string is not a palindrome, just for completion sake.

@apsillers thank you I edited the answer.

There is no function f, your code doesn't assign your arrow function to a variable so it can't be called

@spex anonymous functions are fine to be used

@FelipeNardiBatista My comment wasn't about anonymous functions, it's that he was saying to call the function with f when at the time it didn't exist. The answer has since been updated and there is now a function f and my comment is now outdated.

@spex but that made him lose 4 bytes of his answer... I read the edit logs before replying to you, it's ok to do that

@FelipeNardiBatista Like I said, I'm not against him using an anonymous function. I was against him saying "Call function f with string" when that was impossible. If he had simply changed the usage instructions that would have been a good fix.

Java - 171 169 160 bytes
int q(String s){return s.equals(new StringBuffer(s).reverse().toString())?1:2;}//};2:1?))(gnirtSot.)(esrever.)s(reffuBgnirtS wen(slauqe.s nruter{)s gnirtS(q tni

The comment at the end is to make it a palindrome.
Returns P(alindrome) when the input is palindrome and N(ot) when not.
Ungolfed version:
int q(String s) {
    return s.equals(new StringBuffer(s).reverse().toString()) ? 'P' : 'N';
}//};'N':'P'?))(gnirtSot.)(esrever.)s(reffuBgnirtS wen(slauqe.s nruter{)s gnirtS(q tni

2 bytes saved thanks to @DLosc
Thanks to @Olivier Grégoire for pointing out the incorrect amount of bytes! Fixed now

I believe you can save some bytes by returning ints instead of chars.

I don't know how do check your byte count, but you have 160 bytes, not 161.

You can save 2 bytes by returning 80 for 'P' and 78 for 'N' or use different chars to save even more bytes.

You can save even more bytes by doing new StringBuffer(s).reverse()+"" instead of new StringBuffer(s).reverse().toString()

any reason you're returning an int instead of bool?

Definitely good to have Java answers, and this is in the same spirit as many other answers here, but I can't help but question whether this is valid as a method solution since the comment appears outside the method definition.

Bash + Unix utilities, 49 bytes
[ "$1" = "`rev<<<$1`" ] # ] "`1$<<<ver`" = "1$" [

Input is passed as an argument.
Output is returned in the result code -- 0 for a palindrome, 1 for a non-palindrome.
Maybe someone can do better and not just rely on a comment to make the code itself palindromic.
Try it online!

[[ $1 = \rev<<<$1` ]]is shorter. (Bash[[` syntax, no quote needed)

@Arthur2e5 I tried out your suggestion, but I think the quotes around rev<<<$1 are needed even in the [[...]] solution. Test it with input string '[$]]$[' (which is a palindrome). With those quotes added in to make it work, your solution is the same length as my solution.

Great catch! I forgot that the RHS of == in [[ would be interpreted as a case-like pattern.

@Arthur2e5 I still think there's probably some clever way to make this shorter.

Will this still work if there are newlines in the input? I think you need rev|tac instead of just rev.

@b_jonas The requirements specifically say that the input won't contain newlines. In the 3rd bullet under Clarifications: "Specifically, the input S will only contain printable ASCII characters (including space, but not including newline)."

Ah, thank you.  I indeed missed that part of the spec.

Jelly, 4 bytes
ḂŒŒḂ

Try it online!
Although this loses to the modern UƑU, I figured it may be of historical interest to note that Dennis's solution could have been only 4 bytes. Thanks to a quirk of the parser, any undefined characters--such as Œ outside a valid digraph--act equivalent to two newlines; as such, removing the newline yields a functionally identical solution (if not particularly forward-compatible, should ŒŒ ever hypothetically be added).

Actually, 5 bytes
;R=R;

Try it online!
The truthy output is [1]\n[1], and the falsey output is []\n[] (in both outputs, \n represents a literal newline).
Explanation:
;R=R;
;R=    duplicate input, reverse one copy, test equality (the main palindrome-testing part)
   R   range(1, x+1) - if palindrome, this pushes [1], else it pushes []
    ;  duplicate

Why don't you just do this?

@LeakyNun it has to be a palindrome

C++, 154 Bytes
int m(){std::string g,p="";g=p;std::reverse(p.begin(),p.end());return g==p;}//};p==g nruter;))(dne.p,)(nigeb.p(esrever::dts;p=g;""=p,g gnirts::dts{)(m tni

I have to say, the reverse statement was costly, but I can't imagine much I can do to change that. Being able to cut out the std:: symbols would save me around 10 characters, but "using namespace std;" is quite a few more.
I suppose C++ wasn't really meant for brevity.

Prolog, 44 bytes
p-->[]|[_]|[E],p,[E].%.]E[,p,]E[|]_[|][>--p

This uses definite clause grammars. It is actually a full context free grammar:
p -->
      []            % the empty string
   |                % or
      [_]           % a one character string
   |                % or
      [E],          % one character, followed by
      p,            % a palindrome, followed by
      [E].          % that same character

Usage:
?- phrase(p,"reliefpfeiler").
true

?- phrase(p,"re").
false.

MathGolf, 2 3 bytes
x=x

Try it online!
Explanation
Nothing fancy here, just some usage of implicit input. x reverses strings. Since the stack is empty, the input is reversed and placed on the stack. = checks for equality for the top two elements on the stack. Since the stack has only one element, the other element is fetched from the input, which is the original string. If they are equal, we get 1, otherwise we get a 0. x also works on integers, but since both 0 and 1 are 1-digit numbers, they remain unchanged.
EDIT: made the code a palindrome thanks to Lyxal's comment.

Additionally, the program or function you write must be a palindrome itself (i.e. its source code must be palindromic), making this a restricted-source challenge - x= is not a palindrome

x=x works for 3 bytes

@Lyxal I need to read the specification more closely, thanks for pointing it out!

@maxb Completely unrelated to this challenge, but MathGolf doesn't have a count builtin, does it?

@KevinCruijssen you mean a count of occurrences (like Python's lst.count(x))? Unfortunately that's not included as of now. I haven't really had time to focus on the language in a while, but there are some unused bytes which could be used for new operators if I'm not mistaken.

@maxb Yeah, that was indeed what I meant. I also couldn't really come up with a (short) alternative to do the count manually with the current operations available. Ah well, then I'll just skip that challenge for MathGolf. It does sound like a useful builtin to be added in the future perhaps.

CJam, 13 bytes
l_W%=e#e=%W_l

Explanation:
l_W%=e#e=%W_l
l_            e#Read input twice
  W%          e#Reverse one input
    =         e#Test for equality
     e#e=%W_l e#Comment to be a palindrome

Example:
> l_W%=e#e=%W_l
l_W%=e#e=%W_l
1

> l_W%=e#e=%W_l
Hi
0

> l_W%=e#e=%W_l
hh
1

Try this: l_W%#e#%W_l

J, 15 bytes, 15 characters
-:|.NB. .BN.|:-

Returns 1 if palindrome, 0 if not.
Output:
   f '())('
1
   f 'nope'
0

Explanation:
-:    NB. "Match" verb, checks for equality
|.    NB. Reverses the string

Dyalog APL, 21 Bytes
I decided to avoid a comment-based solution, and ended up with something pretty ugly. Instead of commenting out the second half of my code, I keep it in and allow the resulting syntax error to be part of my output.
A←⍞⋄0∊A=⌽A⋄A⌽=A∊0⋄⍞←A

This prompts the user to enter a string, and prints
0
SYNTAX ERROR: The function requires a left argument
      A←⍞ ⋄ 0∊A=⌽A ⋄ A⌽=A∊0 ⋄ ⍞←A

If the input is a palindrome, and prints
1
SYNTAX ERROR: The function requires a left argument
      A←⍞ ⋄ 0∊A=⌽A ⋄ A⌽=A∊0 ⋄ ⍞←A

If the input is not a palindrome.
A simple comment based solution would be to replace the middle character (⋄) with the comment symbol (⍝):
A←⍞⋄0∊A=⌽A⍝A⌽=A∊0⋄⍞←A

This does the same as above but doesn't include the syntax error in the output.
Here's an ungolfed version:
A←⍞          ⍝ prompt user for input, store in variable A
⋄             ⍝ statement separator
0∊A=⌽A       ⍝ return '0' if A is equal to A reversed (`⌽A`). Otherwise return '1'
⋄             ⍝ statement separator
A⌽=A∊0⋄⍞←A   ⍝ reverse of preceding code, throws a syntax error

Ruby, 39 35 chars
->s{s.reverse==s}#}s==esrever.s{s>-

Welcome to PPCG! Our usual policy (which is also explicitly affirmed in this challenge) is that answers must be either a full program (with input and output) or a function. I'm not super familiar with Ruby, but your code looks like a snippet instead (it's just an expression, and assumes input pre-stored in the s variable). If you change it so it's either a function or a full program, it will be a valid answer.

@DLosc Sure, thanks, I made it a function

Then you can remove the () around s and save 4 bytes.

Golfscript, 11 bytes
Bonus for the bytecount being a palindrome as well.
.-1%=#=%1-.

Duplicate, reverse, compare. Outputs 1 for palindromes and 0 for non-palindromes.

Ruby -n, 31 bytes
p$_==$_.reverse#esrever._$==_$p

Try it online!
A full program with implicit input (-n) turns out to be slightly shorter than lambda.

R, 71 bytes
any(rev(x<-utf8ToInt(scan(,"")))-x)#)x-)))"",(nacs(tnIoT8ftu-<x(ver(yna

Try it online!
Comments to make it a palindrome. Returns FALSE if the input is a palindrome, TRUE  otherwise. Could save 2 bytes off the palindrome using sd if we were guaranteed to have an input size >1.
Interpreting liberally this portion of the asnwer

if you treat the input as a sequence of bytes rather than a sequence of characters, your program will still likely comply with the specification

would lead to:
R, 43 bytes
any(x<-scan()-rev(x))#))x(ver-)(macs-<x(yna

Try it online!

Jelly, 3 bytes
UƑU

Try it online!
Added for the sake of completeness. This uses the fairly new quick Ƒ, which checks whether the argument is the same as the result of the atom being applied. Here, the atom is U, which reverses the argument. The quicklink UƑ returns either 1 for palindromes, or 0 otherwise. The second U has no effect on either integer, so leaves it as is.

W, 3 bytes
Pretty trivial, reverse & check equality & reciprocal. (I definitely beat Jelly by tying with Pyth.)
_=_

Explanation
_   Reverse the implicitly inputted string
 =  Check whether this reversed string is equal to the original string
  _ Negate this string

Google Sheets, 171 167 163
Input is in A1.
=-IFERROR(JOIN(,ArrayFormula(MID(A1,SEQUENCE(LEN(A1),1,LEN(A1),-1),1)))=""&A1,1)&"&)1,1A&""=)))1,)1-,)1A(NEL,1,)1A(NEL(ECNEUQES,1A(DIM(alumroFyarrA,(NIOJ(RORREFI-=

Palindrome: -1&)1A&"=)))1,)1-,)1A(NEL,1,)1A(NEL(ECNEUQES,1A(DIM(alumroFyarrA,(NIOJ(RORREFI-=
Not: 0&)1A&"=)))1,)1-,)1A(NEL,1,)1A(NEL(ECNEUQES,1A(DIM(alumroFyarrA,(NIOJ(RORREFI-=

How it works:

Compare a string with its reverse. I thought it necessary to handle the empty string as well, so I added IFERROR() for the MID().
Coerce to number with -. 1 becomes -1, 0 stays 0.
The only requirement was two distinct outputs, so just concatenate the program's reverse to the end.
We also exploit the fact that Sheets closes quotes and parens at the end.
The center of the palindrome is the &"&

As of now, Sequence appears to have a bug where I can't omit the second argument with a negative step.

05AB1E, 3 bytes
RQR

Try it online!
RQR  # full program
 Q   # is...
     # implicit input...
 Q   # equal to...
     # implicit input...
R    # reversed...
 Q   # ? (1 if yes, 0 if no)
  R  # reverse top of stack (no-op since both 1 and 0 are palindromes)
     # implicit output

x86_64 machine code, 49 bytes
Uses System V ABI calling convention (specifically first arg in RDI, return in RAX, DF cleared by caller).
Hexdump:
00000000: 31c0 575e 31c9 f7d1 f2ae 4883 ef02 803e  1.W^1.....H....>
00000010: 0074 05a6 74f4 ffc0 c3c0 fff4 74a6 0574  .t..t.......t..t
00000020: 003e 8002 ef83 48ae f2d1 f7c9 315e 57c0  .>....H.....1^W.
00000030: 31                                       1

Try it online!
Explanation:
0000000000401020 <test_palindrome>:
  401020:   31 c0                   xor    eax,eax ; clear eax
  401022:   57                      push   rdi
  401023:   5e                      pop    rsi ; copy rdi to rsi

  ; get end of string (by SCASing rdi to find 0)
  401024:   31 c9                   xor    ecx,ecx
  401026:   f7 d1                   not    ecx
  401028:   f2 ae                   repnz scas al,BYTE PTR es:[rdi]

  ; addr of start is in rsi, addr of end (past \0) is
  ; in rdi, so we subtract 2 from rdi. Thankfully this is needed below too,
  ; so we can combine the two steps into one.

  ; Now, we loop, incrementing rsi and decrementing rdi until [rsi] == '\0'
000000000040102a <testp_loop>:
  40102a:   48 83 ef 02             sub    rdi,0x2 ; Shortest way to do this?

  40102e:   80 3e 00                cmp    BYTE PTR [rsi],0x0 ; [rsi] == '\0'?
  401031:   74 05                   je     401038 <retl> ; If so, str is a palindrome (ret0)

  ; Check that [rsi] == [rdi]
  401033:   a6                      cmps   BYTE PTR ds:[rsi],BYTE PTR es:[rdi] ; Auto increments rsi and rdi, so rdi needs subtracting by 2.
  401034:   74 f4                   je     40102a <testp_loop> ; If so, keep looping.

  ; Otherwise, str is not a palindrome (ret1)
  401036:   ff c0                   inc    eax

0000000000401038 <retl>:
  401038:   c3                      ret

  ; <nonsense to make code a palindrome>
  401039:   c0 ff f4 74 a6 05 74 00 3e 80 02 ef 83 48 ae f2 d1 f7 c9 31 5e 57 c0 31

Javascript, 78 bytes
(s=>s==s.split('').reverse().join(''))//))''(nioj.)(esrever.)''(tilps.s==s>=s(

This is the classic .split, .reverse and .join routine.
Another (longer, but I like it more) 104 bytes solution would be
(s=>!s.split('').find((a,i,l)=>a!==l[l.length-i-1]))//))]1-i-htgnel.l[l==!a>=)l,i,a((dnif.)''(tilps.s!>=s(

AppleScript, 146 bytes
clutch
set x to(display dialog""default answer"")'s characters--
x=reverse of x--x fo esrever=x
--sretcarahc s')""rewsna tluafed""golaid yalpsid(ot x tes

This should be fairly obvious.

Common Lisp, 104 bytes
(lambda(s)(format t"~:[F~;T~]"(equal(reverse s)s)));;)))s)s esrever(lauqe("]~T;~F[:~"t tamrof()s(adbmal(

Abusing idea for commenting out part of code from comments under question.

Java (with regex), 134 bytes
s->s.matches("|(?:(.)(?<=(?=^.*?(\\1\\2?)$).*))+(?<=(?=^\\2$).*)")//)")*.)$2\\^=?(=<?(+))*.)$)?2\\1\\(?*.^=?(=<?().(:?(|"(sehctam.s>-s

Credits where due
Testing
import java.util.function.*;

class Ideone {
  static Predicate<String> isPalindrome =
    s->s.matches("|(?:(.)(?<=(?=^.*?(\\1\\2?)$).*))+(?<=(?=^\\2$).*)")//)")*.)$2\\^=?(=<?(+))*.)$)?2\\1\\(?*.^=?(=<?().(:?(|"(sehctam.s>-s
    ;

  public static void main (String[] args) throws java.lang.Exception {
    testPalindrome("", true);
    testPalindrome("x", true);
    testPalindrome("xx", true);
    testPalindrome("xy", false);
    testPalindrome("xyx", true);
    testPalindrome("xxx", true);
    testPalindrome("xxyx", false);
    testPalindrome("racecar", true);
    testPalindrome("step on no pets", true);
    testPalindrome("aManaPlanaCanalPanaMa", true);
    testPalindrome("this is impossible", false);
  }

  static void testPalindrome(String s, boolean expected) {
    if (isPalindrome.test(s) == expected) {
      System.out.println("OK");
    } else {
      System.out.printf("NOK: str=\"%s\", expected=%b%n", s, expected);
    }
  }
}

Test it yourself!

This code is not a lambda expression.

@Jakob No? Why not? It works as a lambda, though.

My complaint is with the comment. Seems to me that having anything outside the lambda expression makes it an invalid lambda solution. In particular, this solution cannot be embedded in a program the way a lambda expression can (e.g. with code appearing after it on the same line). See also the grammar for a lambda expression, which most lambda solutions adhere to, but this doesn't.

Why can't it be embedded? stream.map(a->a//comment<new_line>).collect(...) (replace <new_line> with an actual new line) works well! Just because 99.99% of lambdas adhere to that principle doesn't make this one invalid. Does it? A lambda isn't defined from how it appears in the source, but how it's compiled, and this one compiles just fine, unless proven otherwise.

Well, my concern is not that it doesn't work or that it can't be embedded into a full program; it's that it violates the format of a lambda expression solution. I think I'll create a meta post where this discussion can continue.

Scala, 50 bytes
Failed to not write a comment based solution so this is it:
(s:String)=>s.reverse==s//s==esrever.s>=)gnirtS:s(

QBIC, 17 bytes
;?A=_fA|#|Af_=A?;

Uses a boring comment-like ttrick to make the code a palindrome. Explanation:
;         Get a string literal from the cmd prompt
?         Print -1 for true and 0 for false in the following comparison
A=        Is A equal to
_fA|      A reversed?

#         Start a 'silent' string literal: This only forces the creation of string B
          with the following text, but doesn't inject a reference to B$ here.
|Af_=A?;  Code, reversed, as a string literal.

Pyth - 3 bytes
An alternative 3 byte solution. Palindromes give -1 and non-palindromes give 0.
_q_

Test Suite.
A few more 3 byte solutions:
_/_
_}_

Scala - 58 bytes
def p(s:String)=s.reverse==s//s==esrever.s=)gnirtS:s(p fed

Example -
p("abba") //returns true

p("aabb") //returns false

Common Lisp, 61 bytes
(lambda(n)(equal(reverse n)n));))n)n esrever(lauqe()n(adbmal(

Try it online!
Outputs T when the string is palindrome, NIL otherwise.

Pyt, 1 byte
₽

Try it online!

   implicit input
₽  palindromic test
   implicit output

Previous answer
before I knew that 1 byte solutions were allowed
₽ƥƥ₽

Try it online!

₽ checks for palindromicness (is that a word?)
ƥ prints the answer
ƥ prints nothing
₽ checks the palindromicness of nothing

1 byte. I don't think it ever says that solutions have to be more than a single byte.

Oh that's weird. I could have sworn it did, but maybe it was a different challenge.

Japt, 2 bytes
êê

Try it
ê on its own in Japt creates a palindrome but, when passed a string as an argument (which the second ê is implicitly cast to in this case), it instead tests if a string is palindromic.

Add++, 13 bytes
L,dbR=;=Rbd,L

Try it online!

C (gcc), 118 bytes
Can sadly not come up with any solution without the boring comment approach.
f(char*s){char*t=s+strlen(s);for(;*s&&*s++==*--t;);s=!*s;}//};s*!=s;);t--*==++s*&&s*;(rof;)s(nelrts+s=t*rahc{)s*rahc(f

Try it online!

Reflections, 125 bytes
  _1=1\ /1#\ /+#_
      >~<  >~<
        (0//0)
      \ / >_ / _> / \
)0//0(
<~>  <~>
 _#+/ \#1/ \1=1_

Test it!
Prints code point 0x04 as true, and nothing as false.
There are a few spaces after some lines.
Explanation
The relevant part of the code is:
  _1=1\ /1#\ /+#_
      >~<  >~<
        (0//0)
      \ / >_ /

_ reads a line
1=1 copies it to stack 1
>~< creates a loop over the complete stack:

(0 pushes the top item to stack 0

now stack 0 contains the reverse, and stack 1 the original
1 moves stack 1 to mainstack
>~< loops again:

0) takes the next character from reversed
>_ if original and reversed character are not equal:

end the program by navigating downwards, leaving the field

+ produces the 4
_ prints corresponding character
then the program stops (leaving the field to the right)

The rest is only for palindromic source. I know this is boring.

Perl 5, 29 bytes
$_=reverse=~$_#_$~=esrever=_$

Requres -p0. Outputs 1 if the input is a palindrome, empty otherwise.
Try it online!

Perl 5, 33 bytes
+$_=reverse=~$_+q+_$~=esrever=_$+

Commentless version, requires -p0. Outputs 1 if the input is a palindrome, 0 otherwise.
Try it online!

Vyxal, 3 bytes
Ṙ=Ṙ

Try it Online!
 =  # Equal to...
Ṙ   # Self reversed?
  Ṙ # Reverse the result

Knight, 71 bytes
;=a=pP;=s'';Wp;=s+GpF1s=pSpF1''O?a s a?O''1FpSp=s1FpG+s=;pW;''s=;Pp=a=;

Input the string with a trailing newline.
Try It Online!
In case you're curious, here's the non-palindromized version of the code:
;=a=pP;=s'';Wp;=s+GpF1s=pSpF1''O?a s

Try It Online!

... How does this not error???

@emanresuA How I understand it is that everything after the O?a s isn't evaluated because it is the last instruction the code runs (so there's no chance of any error occurring), so it doesn't matter what you put after the final instruction.

@emanresuA The entire program is a single prefix expression. Once a complete expression is formed, the parser simply stops there.

Julia 1.0, 33 bytes
!x=reverse(x)==x#x==)x(esrever=x!

Try it online!

A comment is used to make the source a palindrome
Returns true for the empty string

[Python], 84 bytes
lambda s:list(s)==list(reversed(list(s)))#)))s(tsil(desrever(tsil==)s(tsil:s adbmal

Pretty simple, take the string s, convert it into a list of chars and then compare that against the reversed list of chars generated from the same string.

This answer is invalid because it isn't a palindrome itself.

@DJMcMayhem missed that caveat, but fixed now, unfortunately ugly. Helps clarify some of the other answers though ;P

Perl 5, 69 bytes
$_=<>;chop;print 1 if reverse eq$_#_$qe esrever fi 1 tnirp;pohc;><=_$
Takes input via STDIN. Prints 1 if the input is a palendrome, otherwise exits.

A couple of hints: you could save quite a few bytes by just printing the boolean returned by eq directly; and you could request input with no trailing newline to avoid the need to call chop.

REXX, 78 bytes
arg a
b="say a=reverse(a)"
interpret b
exit
tixe
b terpretni
")a(esrever=a yas"=b
a gra

I thought that early exit would leave the mirrored program uninterpreted, but at least Regina REXX complains about unbalanced parentheses, hence the INTERPRET workaround.

SmileBASIC, 109 bytes
INPUT P$WHILE LEN(P$)>1P=P+(POP(P$)!=SHIFT(P$))WEND?!P'P!?DNEW))P$(TFIHS=!)$P(POP(+P==P1>)$P(NEL ELIHW$P TUPNI

Could definitely be shorter...

RProgN 2, 5 bytes
]iei]

Returns -1\n-1 for true, 0\n0 for false.
Explained
]iei]
]       # Duplicate the top of the stack.
 i      # Reverse the duplicate
  e     # Are they equal? 1 if true, 0 if false.
   i    # Inverse calculates n*-1. Redunant.
    ]   # Duplicate. Redundant.

Try it online!

BASH, 52 bytes
[ "`rev<<<$1`" = "$1" ];$?$;] "1$" = "`1$<<<ver`" [

success output (run as palpal.bash:
~/workspace/golf $ bash palpal.bash "$(cat palpal.bash)"
palpal.bash: line 1: 0$: command not found
palpal.bash: line 1: 1$: command not found
palpal.bash: line 1: ]: command not found

failure output:
~/workspace/golf $ bash palpal.bash "hello"
palpal.bash: line 1: 1$: command not found
palpal.bash: line 1: 1$: command not found
palpal.bash: line 1: ]: command not found

notice that first output line has either a 1 or 0 which are the return code of the actual palindrome check.
It's not much better than using a comment for the second half

Kotlin, 32 bytes
Just another "boring" solution but in Kotlin :))
s.reversed()==s//s==)(desrever.s

Try it online!

C++ (gcc), 138 bytes
[](auto s){return equal(s.begin(),s.begin()+s.size()/2,s.rbegin());}//};))(nigebr.s,2/)(ezis.s+)(nigeb.s,)(nigeb.s(lauqe nruter{)s otua(][

Lambda using a builtin to check if the argument is palindromic. To make it palindromic, I had to add the entire source, reversed, in a comment. Not very creative, I know. Note that clang will not compile this.
Try it online here.

Gol><>, 31 bytes
iEv
?;>l2(q1h{-
-{h1q(2l>;?
vEi

Try it online!
iEv
?;>l2(q1h{-

iEv
i    Take input as a char
 E   If the last input was EOF, pop and execute next; otherwise, skip 1
iEv  Take all input and move to next line

>l2(q1h{-?;
 l2(         Is the stack length < 2? (1 if yes, 0 otherwise)
    q        If not, skip 2 commands (consume the top)
     1h      Print 1 and halt
       {     Rotate the stack (bottom goes to the top)
        -    Difference
         ?   If zero, skip one command (consume the top)
          ;  Halt without printing anything

C# (.NET Core), 110 bytes
s=>Console.Write(new string(s.Reverse().ToArray())==s)//)s==))(yarrAoT.)(esreveR.s(gnirts wen(etirW.elosnoC>=s

Try it online!

Pascal (FPC), 139 bytes
uses strutils;var s:string;begin read(s);write(s=ReverseString(s))end.dne))s(gnirtSesreveR=s(etirw;)s(daer nigeb;gnirts:s rav;sliturts sesu

Try it online!
The program compares if the input is equal to its reverse using ReverseString() function from module strutils.
end. is the last part of the program. This program does not use comments because, in most cases, FPC does not care what is after end., so the program without the dot is simply reversed and appended to the program itself.

T-SQL, 70 bytes
SELECT IIF(s=REVERSE(s),1,0)FROM t--t MORF)0,1,)s(ESREVER=s(FII TCELES

Didn't see a SQL version, so here's my try. Returns 1 for a palindrome, and 0 otherwise. IIF is supported by SQL 2012 and later.
Input is via pre-existing table t with varchar field s, per our IO rules. The input table can include multiple rows.
The -- in the middle is a comment character.
Edit: Here's a more clever version, using a strangely-named input table instead of an extended comment. Unfortunately slightly longer (73 bytes):
--"
SELECT IIF(s=REVERSE(s),1,0)FROM"MORF)0,1,)s(ESREVER=s(FII TCELES
"--

This requires an input table with a long strange name:
CREATE TABLE [MORF)0,1,)s(ESREVER=s(FII TCELES
] (s VARCHAR(999))

Note the return is included in the table name (not a recommended naming strategy for your databases, by the way).
Tables with otherwise invalid characters in their name need brackets or double-quotes around them, and the only way I could put the required quote at the beginning was to set it after a comment.

C# (.NET Core), 94
s=>Console.Write(s.SequenceEqual(s.Reverse()))//)))(esreveR.s(lauqEecneuqeS.s(etirW.elosnoC>=s

Improves slightly on the answer from Anderson Pimentel
Try it online

MUMPS, 36 bytes
r r r w r=$re(r) ; )r(er$=r w r r r

Explanation
There are no reserved keywords in MUMPS; the compiler just uses context to decide if you you are referencing a routine, command, or variable.
r :  define routine "r"
r r :  read input and assign to variable "r"
w r=$re(r) : write 1 if "r" equals its reverse ($re is the shortened form of $reverse)
; )r(er$=r w r r r : lame comment to make palindromic
Ungolfed version:
palindromeRoutine
 read input
 write input=$reverse(input)

GolfScript, 11 bytes
.0(%=1=%(0.

Try it online!
Outputs via error. Throws an undefined method error if the input is a palindrome and a ZeroDivisionError otherwise.


text:
Expand Exponentiation
Given two integers greater than one, A and B, output four mathematical expressions in this order:

The plain expression A^B (A to the power B). e.g. if A = 2 and B = 3, 2^3.

The expansion of A^B in terms of repeated multiplications of A. e.g. 2*2*2.

The expansion of A^B in terms of repeated additions of A. e.g. 2+2+2+2.

The expansion of A^B in terms of repeated additions of 1. e.g. 1+1+1+1+1+1+1+1.

The four expressions may be output in any reasonable way as long as they are in order and clearly distinct. For example, you might put them in a list, or print them on separate lines
2^3
2*2*2
2+2+2+2
1+1+1+1+1+1+1+1

or perhaps on one line separated by equals signs:
2^3=2*2*2=2+2+2+2=1+1+1+1+1+1+1+1

Spaces may be inserted next to math operators so
2^3 = 2 * 2 * 2 = 2 + 2 + 2 + 2 = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1

would be equally valid output when A = 2 and B = 3.
You may use symbols alternative to ^, *, and +, but only if the new symbols are more idiomatic for your language (e.g. ** instead of ^ in Python).
You may assume that A and B are sufficiently small so that A^B will not overflow your language's default integer type (given that that type has a reasonable maximum, 255 at least).
The shortest code in bytes wins.
Test Cases
One output per line. The input can be inferred as the first expression is always A^B.
2^2 = 2*2 = 2+2 = 1+1+1+1
2^3 = 2*2*2 = 2+2+2+2 = 1+1+1+1+1+1+1+1
2^4 = 2*2*2*2 = 2+2+2+2+2+2+2+2 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
2^5 = 2*2*2*2*2 = 2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
3^2 = 3*3 = 3+3+3 = 1+1+1+1+1+1+1+1+1
3^3 = 3*3*3 = 3+3+3+3+3+3+3+3+3 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
3^4 = 3*3*3*3 = 3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
3^5 = 3*3*3*3*3 = 3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
4^2 = 4*4 = 4+4+4+4 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
4^3 = 4*4*4 = 4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
10^2 = 10*10 = 10+10+10+10+10+10+10+10+10+10 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
13^2 = 13*13 = 13+13+13+13+13+13+13+13+13+13+13+13+13 = 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1

@JonathanAllan Yeah, you got all the typos I saw. Nice job! You get nothing.

You get thanks from me @JonathanAllan. R. Kap had me worrying about all my 3's

Well, (luckily) there were no misplaced ='s to the left of any 3's.

Please don't do "expand knuth's up arrows notation" next time

If we read input from STDIN as a single string, is 2^3 a valid input format? Or does it have to be space/comma/linefeed-separated or something?

Funny. Just today, I thought of making a challenge like this. But my idea was just for expanding squaring, by showing N copies of N, adding the first N odds, or the sum of N times its binary representation's powers of 2.

@Martin that sounds ok

Cubix, 238 234 217 151 110 100 bytes
Saved 14 bytes thanks to ETHProductions
u'^.:s+.;;;\-?W?rsos\(rrOIO:ur>'=o;^u.;;.>$.vUo^'rsu1;;@!\q?s*su;;IOu*+qU../;(*\(s.;<..r:''uq....qu\

Expanded:
          u ' ^ . :
          s + . ; ;
          ; \ - ? W
          ? r s o s
          \ ( r r O
I O : u r > ' = o ; ^ u . ; ; . > $ . v
U o ^ ' r s u 1 ; ; @ ! \ q ? s * s u ;
; I O u * + q U . . / ; ( * \ ( s . ; <
. . r : ' ' u q . . . . q u \ . . . . .
. . . . . . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

Try it online!
Try it here
Explanation
The code consists of 8 steps, with two loops. I'll go over the code part by part.
Step 1 (A^B)
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
I O : u . . . . . . . . . . . . . . . .
U o ^ ' . . . . . . . . . . . . . . . .
; I O u . . . . . . / ; ( * \ . . . . .
? ? r : . . . . . . ? . . . \ ? ? ? ? ?
. . . . ? . . . . . ? . . . . . . . . .
          ? ? ? ? ?
          . . . . .
          . . . . .
          . . . . .
          . . . . .

This is the cube with the parts that are irrelevant to the first step removed. The question mark shows the no-ops the IP will visit, to make its path more clear.
IO:'^o;IO:r*(; # Explanation
I              # Push the first input (A)
 O             #   output that
  :            #   duplicate it
   '^          # Push the character "^"
     o         #   output that
      ;        #   pop it from the stack
       I       # Push the second input (B)
        O      #   output that
         :     #   duplicate
          r    #   rotate top 3 elements
           *   # Push the product of the top two elements
            (  #   decrease it by one
             ; #   pop it from the stack (making the last
               #   two operations useless, but doing it
               #   this way saves 10B)

Now, the stack looks like this: A, B, A, B
Step 2 (prepare for print loop)
The print loop takes 3 arguments (the top 3 elements on the stack): P, Q and R. P is the amount of repetitions, Q is the separator (character code) and R is the number to repeat. Luckily, the loop also takes care of the requirement that the resulting string should end in R, not Q.
We want to repeat A* exactly B times, so the separator is *. Note that the stack starts as A, B, A, B. Once again, I removed all irrelevant instructions. The IP start at the S pointing north.
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
. . . . r . . . . . . . . . . . . . . .
. . . . r . . . . . . . . . . . . . . .
. . . . * . . . . . . . . . . . . . . .
. . . . ' . . . . . . . . . . . . . . .
. . . . S . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

'*rr # Explanation
'*   # Push * (Stack: A, B, A, B, *)
  rr # Rotate top three elements twice

The stack is now A, B, B, *, A.
Step 3/6/8 (the print loop)
Concept
E . . . . .
? r s o s u
\ ( r r O <
. . . . . S

The IP enters the loop through S, pointing north, and exits the loop at E, pointing north again. For this explanation, the stack is set to [..., A, B, C]. The following instructions are executed. Note that the IP can't leave the loop before the question mark, so the first four instructions will always be executed.
Orr(?rsos # Explanation
O         # Output `C`
 rr       # Rotate top three elements twice (Stack: [..., B, C, A])
   (      # Decrease A by one (Stack: [..., B, C, A-1])
    ?     # If top of stack (A) > 0:
     r    #    Rotate top of stack (Stack: [..., A-1, B, C])
      s   #    Swap top elements (Stack: [..., A-1, C, B])
       o  #    Output top of stack (B) as character code
        s #    Swap top elements (Stack: [..., A-1, B, C]
          #
          # ... and repeat ...

Implementation
Here's the cube again, with the irrelevant parts removed. The IP starts at S, pointing east.
          . . . . .
          . . . . .
          . . . . .
          ? r s o s
          \ ( r r O
. . . . . S ' = o ; ^ u . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

As you can see, the IP comes across four instructions before it enters the loop. Since the character code is removed again, we reach the loop with the exact same stack as we entered this part.
'=o; # Explanation
'=   # Push =
  o  #     Output
   ; #     Pop from stack

Inside the loop, the explanation above holds.
Step 4 (differentiating the IPs)
Since we use the above loop multiple times, and they all cause the IP to end up in the same spot, we have to differentiate between multiple runs. First, we can distinguish between the separator (first run has a *, whereas runs two and three have a + as separator). We can differentiate between runs 2 and 3 by checking the value of the number that is repeated. If that is one, the program should terminate.
First comparison
Here's what it looks like on the cube. The IP starts at S and points north. The stack contains [..., * or +, A or 1, 0]. The number 1 shows where the IP will end up if this is the first loop (pointing north) and the number 2 shows where the IP will end up if this is the second (or third) loop (pointing east).
          u ' . . .
          s + . 1 .
          ; \ - ? 2
          S . . . .
          . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

;s'+-? # Explanation
;      # Delete top element (0)
 s     # Swap the top two elements (Stack: 1/A, */+)
  '+   # Push the character code of +
    -  # Subtract the top two elements and push
       #  that to the stack (Stack: 1/A, */+, +, (*/+)-+)
     ? # Changes the direction based on the top
       # item on the stack. If it's 0 (if (*/+) == +)
       # the IP continues going right, otherwise, it
       # turns and continues going north.

If the IP now is at 1, the stack is [A, *, +, -1]. Otherwise, the stack is [A or 1, +, +, 0]. As you can see, there still is an unknown in the stack of the second case, so we have to do another comparison.
Second comparison
Because the IP has gone through step 5, the stack looks like this: [A^(B-1) or nothing, A or 1, +, +, 0]. If the first element is nothing, the second element is 1, and the reverse holds too. The cube looks like this, with the IP starting at S and pointing east. If this is the second loop, the IP ends up at E, pointing west. Otherwise, the program hits the @ and terminates.
          . . . . .
          . . . . ;
          . . . S W
          . . . . .
          . . . . .
. . . . . . . . . . . . . ; . . . . . .
. . . . . . . . . E @ ! \ q . . . . . .
. . . . . . . . . . . . ( * . . . . . .
. . . . . . . . . . . . q u . . . . . .
. . . . . . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

The instructions executed that don't do anything to the control flow are listed below.
;;q*q(!@
;;       # Delete top two elements (Stack [A^(B-1)/null, A/1, +])
  q      # Send top element to the bottom (Stack [+, A^(B-1)/0, A/1])
   *     # Push product of top two elements
         #    (Stack [+, A^(B-1)/0, A/1, A^B/0])
    q    # Send top element to the bottom
         #    (Stack [A^B/0, +, A^(B-1)/0, A/1])
     (   # Decrease the top element by 1
         #    (Stack [A^B/0, +, A^(B-1)/0, (A-1)/0])
      !  # If (top element == 0):
       @ #  Stop program

The stack is now [A^B, +, A^(B-1), A-1], provided the program didn't terminate.
Step 5 (preparing for "A+" (repeat A^(B-1)))
Sadly, Cubix doesn't have a power operator, so we need another loop. However, we need to clean up the stack first, which now contains [B, A, *, +, -1].
Cleaning up
Here's the cube again. As usual, the IP starts at S (pointing north), and ends at E, pointing west.
          . . . ? .
          . . . ; .
          . . . S .
          . . . . .
          . . . . .
. . . . . . . . . . . . . . . . > $ . v
. . . . . . . . . . . . . . . . . . . ;
. . . . . . . . . . . . . . . . . . E <
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

;; # Explanation
;; # Remove top 2 elements (Stack: [B, A, *])

Calculating A^(B-1)
Another loop which works roughly the same as the print loop, but it's a bit more compact. The IP starts at S, pointing west, with stack [B, A, *]. The IP exits at E pointing north.
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
. . . . . . . . . . . . . . E . . . . .
. . . . . . . . . . . . . . ? s * s u .
. . . . . . . . . . . . . . \ ( s . ; S
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

The loop body is the following.
;s(?s*s # Explanation
;       # Pop top element.
 s      # Shift top elements.
  (     # Decrease top element by one
   ?    # If not 0:
    s   #    Shift top elements again
     *  #    Multiply
      s #    Shift back
        #
        # ... and repeat ...

The resulting stack is [A, A^(B-1), 0].
Cleaning up the stack (again)
Now we need to get to the print loop again, with the top of the stack containing [..., A^(B-1), +, A]. To do this, we execute the following. Here's the cube again,
          . . ^ ? :
          . . . . .
          . . . . .
          . . . . .
          E . . . .
. . . . . s . . . . . . . . ; . . $ . .
. . . . . + q U . . . . . . S . . s . .
. . . . . ' u q . . . . . . . . . ? . .
. . . . . . . ? . . . . . . . . . ? . .
. . . . . . . ? . . . . . . . . . ? . .
          . . ? . .
          . . ? . .
          . . ? . .
          . . ? . .
          . . ? . .

;:$sqq'+s # Explanation
;         # Delete top element (Stack: [A, A^(B-1)])
 :        # Copy top element
  $s      # No-op
    qq    # Send top two elements to the bottom
          #   (Stack: [A^(B-1), A^(B-1), A])
      '+  # Push +
          #   (Stack: [A^(B-1), A^(B-1), A, +])
        s # Swap top two elements
          #   (Stack: [A^(B-1), A^(B-1), +, A])

Step 7 (preparing for last loop)
The stack is now [A^B, +, A^(B-1), A-1], the IP starts at S, going west, and ends at E, going right.
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
. . . . . E . . . . . . . . . . . . . .
. . . . . . u 1 ; ; S . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .
          . . . . .

The instructions executed:
;;1 # Explanation
;;  # Delete top two elements
  1 # Push 1

The stack now looks like [A^B, +, 1], and the IP is about to enter the print loop, so we're done.

Yes please make an explanation, at least make an ungolfed cube net version

I have completed the explanation

Who made this language... It's like hex-agony but cube-agony. Someone make a 3D hex-agony.

ETHproductions did. After I created this program, I added a few commands, and I'm currently working on a special code page for this, because it's such an awesome language.

@carusocomputing And what polyhedron would be a 3D hex, hm?

@mbomb007 Ha, good point! I suppose it'd be something closer to a soccer ball. "Truncated icosahedrony" :P?

You could probably make a language that runs on a 3D structure of tessellated tetrahedrons.

Python 3.6, 88 74 bytes
-2 bytes thanks to Dada (use ~)
-5 bytes thanks to Erwan (use f-strings from Python 3.6)
lambda a,b:f"{a}^{b}={a}{f'*{a}'*~-b}={a}{f'+{a}'*~-a**~-b}=1"+"+1"*~-a**b

online ide anyone?
How?
This is an unnamed function taking the two integer inputs a and b each greater than 0 (even though the specification is only for those greater than 1).
In Python 3.6 a new feature is available, namely formatted string literals or "f-strings". These allow run-time evaluated string construction. A leading f (or F) creates such a construct, e.g. f"blah" or f'blah'. Inside an f-string anything between a pair of braces, {...}, is an expression to be evaluated.
As such f"{a}^{b}={a}{f'*{a}'*~-b}={a}{f'+{a}'*~-a**~-b}=1" evaluates each of a, b, a, f'*{a}'*~-b, a, and f'+{a}'*~-a**~-b} as expressions, keeping the ^, =, =, and =1 as strings,all of which gets concatenated together.
The a and b expressions evaluate to the representations of a and b respectively.
The f'*{a}' and f'+{a}' in turn are also f-strings inside these expressions, which evaluate to a with a leading '*' and a leading '+' respectively
To create the required number of as and operations for the * and + portions note that there will be b as multiplied together and a**(b-1) as added together. Each case then requires one less operator sign than the number of as. So we can repeat the f-strings f'*{a}and f'+{a}' (using *) as many times as there are operators and prepend each with a single a. (b-1) is ~-b and (a**(b-1))-1 is ~-a**~-b.
The same  is done for the 1s using (a**b)-1 being ~-**b, but we don't need the overhead of f-strings since 1 is constant, so a standard string repeated is concatenated with +.

Prior Python versions, 81:
lambda a,b:'%s^%s=%s=%s=1'%(a,b,('*%s'%a*b)[1:],('+%s'%a*a**~-b)[1:])+'+1'*~-a**b

Try it online!

Can't you replace (b-1) with ~-b ?

Yes you are right, I missed that.

you can win 5 bytes, if you use f string from python 3.6:
lambda a,b:f"{a}^{b}={(f'*{a}'*b)[1:]}={(f'+{a}'*a**~-b)[1:]}=1"+'+1'*~-a**b

@Erwan yes, I was planning on using f strings when I returned (now). I can save a couple more too.

Always good to see the tadpole operators.

MATL, 46 bytes
XH'^'i'='XJ2G:"H'*']xJ&Gq^:"H'+']xJ&G^:"1'+']x

Try it online!
Stretching the limits of "reasonable way" here, but the expressions are separated.
Explanation
First expression:
XH'^'i'='XJ

XH         % implicitly take input A, save it to clipboard H
'^'        % push literal '^'
i          % take input B
'='        % push literal '='
XJ         % copy '=' to clipboard J, we'll use this twice more so it's worth it

Second expression:
2G:"H'*']xJ

2G         % paste the second input (B) again
:"         % do the following B times
  H        % paste A from clipboard H
  '*'      % push literal '*'
]          % end loop
x          % delete the final element (at the moment we have a trailing *)
J          % paste '=' from clipboard J

Third expression:
&Gq^:"H'+']xJ

&G         % paste all of the input, ie push A and B
q          % decrement B
^          % power, giving A^(B-1)
:"         % do the following A^(B-1) times
  H        % paste A from clipboard H
  '+'      % push literal '+'
]          % end loop
x          % delete the final element (at the moment we have a trailing +)
J          % paste '=' from clipboard J

Fourth expression:
&G^:"1'+']x

&G         % paste all of the input, ie push A and B
^          % power, giving A^B
:"         % do the following A^B times
  1        % push 1
  '+'      % push '+'
]          % end loop
x          % delete the final element (at the moment we have a trailing +)
           % (implicit) convert all to string and display

JavaScript (ES7), 78 bytes
Takes input in currying syntax (a)(b). Outputs a string.
a=>b=>a+'^'+b+(g=o=>'='+a+('+*'[+!o]+a).repeat(b-1))()+g(b=a**~-b)+g(b*=a,a=1)

Test cases

let f =

a=>b=>a+'^'+b+(g=o=>'='+a+('+*'[+!o]+a).repeat(b-1))()+g(b=a**~-b)+g(b*=a,a=1)

console.log(f(2)(2));
console.log(f(2)(3));
console.log(f(2)(4));
console.log(f(2)(5));
console.log(f(3)(2));
console.log(f(3)(3));
console.log(f(3)(4));
console.log(f(3)(5));
console.log(f(4)(2));
console.log(f(4)(3));
console.log(f(10)(2));
console.log(f(13)(2));

05AB1E, 30 bytes
mUð¹'^²J'*¹«²×'+¹«X¹÷×„+1X×)€¦

Explanation:
mU                               # Store a^b in variable X
  ð                              # Push a space character to the stack (will be deleted at the end, but this is needed to keep the character count low)
   ¹'^²J                         # Push the string "a^b" to the stack
        '*¹«                     # Push the string "*a" to the stack
            ²×                   # Repeat b times
              '+¹«               # Push the string "+a" to the stack
                  «X¹÷×          # Repeat a^b / a times
                       „+1       # Push the string "+1" to the stack
                          X×     # Repeat a^b times
                            )    # Wrap stack to array
                             €¦  # Remove the first character from each element in the array

Try it online!

¹²'^ý ¹'*¹«²<×«¹²m¹÷¹s×S'+ý 1¹²m×S'+ý», why you beat me by 5 bytes :(?

Because I am. :P

For some reason I saw your answer and read "80 bytes" and thought to myself, "easy to  beat", then I created mine with the goal of 80 in mind... Then again, I think mines shorter at some things and so is yours haha.

¹²«¹²×¹¹²m©¹÷×1®×)vySN"^*++"èý, is closer ;). You're only winning by 1 now ;).

Ruby, 52 bytes
->a,b{[[a,b]*?^,[a]*b*?*,[a]*a**~-b*?+,[1]*a**b*?+]}

Java 7, 170 bytes
String c(int a,int b){String s="=",r=a+"^"+b+s+a;double i=0,x=Math.pow(a,b);for(;++i<b;r+="*"+a);r+=s+a;for(i=0;++i<x/a;r+="+"+a);r+=s+1;for(i=0;++i<x;r+="+1");return r;}

Ungolfed:
String c(int a, int b){
  String s = "=",
         r = a+"^"+b+s+a;
  double i = 0,
         x = Math.pow(a,b);
  for(; ++i < b; r += "*"+a);
  r += s+a;
  for(i = 0; ++i < x/a; r += "+"+a);
  r += s+1;
  for(i = 0; ++i < x; r += "+1");
  return r;
}

Test code:
Try it here.
class M{
  static String c(int a,int b){String s="=",r=a+"^"+b+s+a;double i=0,x=Math.pow(a,b);for(;++i<b;r+="*"+a);r+=s+a;for(i=0;++i<x/a;r+="+"+a);r+=s+1;for(i=0;++i<x;r+="+1");return r;}

  public static void main(String[] a){
    System.out.println(c(2,2));
    System.out.println(c(2,3));
    System.out.println(c(2,4));
    System.out.println(c(2,5));
    System.out.println(c(3,2));
    System.out.println(c(3,3));
    System.out.println(c(3,4));
    System.out.println(c(3,5));
    System.out.println(c(4,2));
    System.out.println(c(4,3));
    System.out.println(c(10,2));
    System.out.println(c(13,2));
  }
}

Output:
2^2=2*2=2+2=1+1+1+1
2^3=2*2*2=2+2+2+2=1+1+1+1+1+1+1+1
2^4=2*2*2*2=2+2+2+2+2+2+2+2=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
2^5=2*2*2*2*2=2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
3^2=3*3=3+3+3=1+1+1+1+1+1+1+1+1
3^3=3*3*3=3+3+3+3+3+3+3+3+3=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
3^4=3*3*3*3=3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
3^5=3*3*3*3*3=3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
4^2=4*4=4+4+4+4=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
4^3=4*4*4=4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
10^2=10*10=10+10+10+10+10+10+10+10+10+10=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
13^2=13*13=13+13+13+13+13+13+13+13+13+13+13+13+13=1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1

C (gcc), 156 149 bytes
#define q for(x=0;x
x,y;p(a,b,c){printf("%c%d",x?b:61,c),x+=a;}e(n,i){x=1;p(0,0,n);p(0,94,i);y=!!i;q<i;y*=n)p(1,42,n);q<y;)p(n,43,n);q<y;)p(1,43,1);}

-2 bytes if we can ignore 0 powers; y=!!i may become y=1
Try it online!

Brainfuck, 372 bytes
,.>++++++++[>++++++++++++>++++++++>+++++<<<-]>--.<,.>>---.>++>++++++++[<<<<------>>>>-]<<<<-[<.>>>>.>>+<<<<<-]<.>>>.<<++++++++[<------>-]<[>+>>>>+<<<<<-]>>>>>>>+<[->[-<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<]>[-<+>]<<]>[<+>>+<-]>[<+>-]<<<<<<<<++++++++[>++++++<-]>>>>+>>-[<<<<<.>>>.>>-]<<<<<.>>.>>>>[<+>-]<<[->[->+>+<<]>>[-<<+>>]<<<]>>>++++++++[<<<++++++>>>-]<<<+>>-[<<.<.>>>-]<<.

Try it online!
Notes

The two inputs must be chosen in such a way, that A**B does not exceed 255. This is because brainfuck can only store values of one byte.
If one input is bigger than 9, use the next ASCII character. 10 becomes :, 11 becomes ; etc. This is because Brainfuck can only take inputs of one byte.

Explanation
Here is my somewhat commented code. I'll expand on this later.
,.                      print A
> +++++ +++
[
    > +++++ +++++ ++    set up 96 (for ^ sign)
    > +++++ +++         set up 64 (for = sign)
    > +++++             set up 40 (for plus and * sign)
    <<< -
]
> --.                   print ^
< ,.                    print B
>
> ---.                  print =
> ++                    prepare *

> +++++ +++             convert B from char code
[
    <<<< ----- -
    >>>> -
]

<<<< -                  print loop "A*"
[
    < .
    >>>> .
    >> +
    <<<<< -
]
< .                     print final A
>>> .                   print =

<< +++++ +++            convert A from char code
[
    < ----- -
    > -
]

<
[                       duplicate A
    > +
    >>>> +
    <<<<< -
]

>>>>>                   exponentiation (A**(B minus 1))
>>+<[->[-<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<]>[-<+>]<<]<

>>
[                       duplicate
    < +
    >> +
    < -
]

>[<+>-]                 move

<<<<< <<< +++++ +++     convert A to char code
[
    > +++++ +
    < -
]

>>>> +                  convert * to plus sign
>> -                    print loop "A plus"
[
    <<<< < .
    >>> .
    >> -
]
<<<<< .                 print final A
>> .                    print =

>>>>                    move
[
    < +
    > -
]

                        multiply A**(B minus 1) by A
<<[->[->+>+<<]>>[-<<+>>]<<<]

>>> +++++ +++           generate the char code for 1 (49)
[                           generate 8*6 = 48
    <<< +++++ +
    >>> -
]
<<< +                       add one

>> -                    print loop "1 plus"
[
    << .
    < .
    >>> -
]
<< .                    print final 1

Jelly, 29 bytes
*⁹’,¤;@
,`;1ẋ"ç
,W;çj"“^*++”Y

Try it online!
How?
*⁹’,¤;@ - Link 1, get list lengths: a, b
    ¤   - nilad followed by link(s) as a nilad
 ⁹      - right: b
  ’     - decrement: b-1
   ,    - pair with right: [b-1, b]
*       - exponentiate: [a^(b-1), a^b]
     ;@ - concatenate with reversed arguments: [b, a^(b-1), a^b]

,`;1ẋ"ç - Link 2, create lists: a, b
 `      - monad from dyad by repeating argument
,       - pair: [a, a]
  ;1    - concatenate 1: [a, a, 1]
      ç - last link (1) as a dyad: [b, a^(b-1), a^b]
     "  - zip with the dyad...
    ẋ   -     repeat list:  [[a, a, ..., a], [a, a, ..., a], [1, 1, ..., 1]]
                                <- b ->       <- a^(b-1) ->     <- a^b ->

,W;çj"“^*++”Y - Main link: a, b
,             - pair: [a, b]
 W            - wrap: [[a, b]]
   ç          - last link (2) as a dyad: [[a, a, ..., a], [a, a, ..., a], [1, 1, ..., 1]]
  ;           - concatenate [[a, b], [a, a, ..., a], [a, a, ..., a], [1, 1, ..., 1]]
      “^*++”  - list of characters: ['^', '*', '+', '+']
     "        - zip with the dyad...
    j         -     join: ["a^b", "a*a*...*a", "a+a+...+a", "1+1+...+1"]
            Y - join with line feeds
              - implicit print

tinylisp repl, 178 186 bytes
(load library
(d W(q((_ N S #)(i(e # 1)(c N _)(W(c S(c N _))N S(s # 1
(d ^(q((x y)(i y(*(^ x(s y 1))x)1
(d X(q((A B)(list(list A(q ^)B)(W()A(q *)B)(W()A(q +)(^ A(s B 1)))(W()1(q +)(^ A B

Using the repl saves 8 bytes in implied closing parentheses at the ends of lines. Defines a function X which takes two numbers and returns a list of expressions. Each expression is parenthesized, with spaces around the operators (actually, it's a list of numbers and operator symbols):
((2 ^ 3) (2 * 2 * 2) (2 + 2 + 2 + 2) (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1))

Hopefully this output format is acceptable. Try it online! (with several test cases).
Explanation
(load library)

We need two functions from the standard library: list and *.
(d W(q((_ N S #)(i(e # 1)(c N _)(W(c S(c N _))N S(s # 1))))))

Define a function W (short for "weave") that takes an accumulator _, a number N, a symbol S, and a count #. We will use this function to generate most our expressions: for example, (W () 2 (q +) 3) will result in (2 + 2 + 2).
If the count is 1 (e # 1), then cons the number to the front of the accumulator (c N _) and return that. Otherwise, recurse:

New accumulator is (c S(c N _)): the symbol and the number cons'd to the front of the previous accumulator;
N and S are the same;
New count is (s # 1): count - 1.

The accumulator idiom is needed to achieve proper tail recursion, preventing a recursion depth error. (This change is responsible for the +8 to the byte count. The 13^2 case didn't work in the previous version.)
(d ^(q((x y)(i y(*(^ x(s y 1))x)1))))

Unfortunately, the library has no exponentiation function at this time, so we have to define one. ^ takes x and y. If y is truthy (nonzero), we recurse with y-1 ((s y 1)) and multiply the result by x. Otherwise, y is zero and we return 1.
(Note: This function does not use proper tail recursion. I assume that the exponents will be small enough that it won't matter. Some experimenting on TIO indicated a maximum exponent of 325, which I would argue should be sufficient for this question. If the OP disagrees, I will change it.)
(d X(q((A B)(list(list A(q ^)B)(W()A(q *)B)(W()A(q +)(^ A(s B 1)))(W()1(q +)(^ A B))))))

Finally, the function we're interested in, X, takes A and B and returns a list of four items:

(list A(q ^)B): a list containing A, a literal ^, and B;
(W()A(q *)B): call W to get a list of B copies of A, interwoven with literal *;
(W()A(q +)(^ A(s B 1))): call W to get a list of A^(B-1) copies of A, interwoven with literal +;
(W()1(q +)(^ A B)): call W to get a list of A^B copies of 1, interwoven with literal +.

Javascript 115 113 104 bytes
Thanks to @Neil and @TuukkaX for golfing off one byte each and @ETHproductions and Luke for golfing off 9 bytes
a=>b=>[a+'^'+b,(a+'*').repeat(b-1)+a,(a+'+').repeat(Math.pow(a,b-1)-1)+a,1+'+1'.repeat(Math.pow(a,b)-1)]

Try it Online

You could use the currying syntax: a=>b=>.

Why not '=1'+'+1'.repeat?

You can save a further byte with .join: a=>b=>[a+'^'+b,(a+'*').repeat(b-1)+a,(a+'+').repeat(Math.pow(a,b-1)-1)+a,1+'+1'.repeat(Math.pow(a,b)-1)].join`=`

If you interpret "The four expressions may be output in any reasonable way as long as they are in order and clearly distinct." to also include returning an array with four different elements, you don't even need the .join()...

Pip, 38 35 34 bytes
33 bytes of code, +1 for -n flag.
Ya**b[gJ'^aRLbJ'*aRLy/aJ'+1XyJ'+]

Takes A and B as command-line arguments; prints one expression per line. Try it online!
Explanation
Ya**b is setup code: yank a**b into the y variable. After that, we have a list (in []) containing our four expressions:

gJ'^: take full arglist (here, a list containing a and b) and Join it on ^
aRLbJ'*: use RepeatList to create a list with b copies of a, then Join it on *
aRLy/aJ'+: use RL to create a list with y/a (i.e. a**(b-1)) copies of a, then Join it on +
1XyJ'+: 1, string-multiplied by y, Joined on +

The list is printed with newline as the separator thanks to the -n flag.

R, 147 bytes
w=switch;function(A,B)for(s in letters[1:4]){cat(rep(w(s,d=1,a=c(A,B),b=,c=A),w(s,a=1,b=B,c=A^B/A,d=A^B)),sep=w(s,a="^",b="*",d=,c="+"));cat("\n")}

Anonymous function that outputs the required, well, outputs, line-by-line. This solution makes extensive use of the switch function.
The switch function takes an expression (here, s) that evaluates to a number or a character string (see ?switch), followed by the alernatives corresponding to s. If an alternative is missing (e.g. switch(s, a=, b= "PPCG"), the next non-missing alternative is evaluated (in the example, s="a" outputs "PPCG").
The rep functions repeats (replicates, actually) its first argument the number of times indicated in the second argument.
cat, to finish, concatenate and prints the objects, with a separator that can be chosen with the sep = argument. The second cat function is here for the line-break.
Ungolfed:
f=function(A,B)
    for(s in letters[1:4]){
        cat(
            rep(switch(s, d = 1, a = c(A,B), b =, c = A),
            switch(s, a = 1, b = B, c = A^B/A, d = A^B)),
        sep=switch(s,a = "^", b = "*", d =, c = "+"))
    cat("\n")
}

CJam, 42 bytes
q_'#/)i*_'**\__:i:*_@0=i/@0=*'+*\'1*'+*]N*

Try it online!

k, 44 bytes
{"^*++"{x/$y}'(x,y;y#x;(x*y-1)#x;(*/y#x)#1)}

Test cases.

Cardinal 202 bytes
%:.~:#"^"."=">v
x            "~
             *.
     >~=088v "~
     v88+88< ?
     8       -
     8      x#<
     v     < 0
     >   t / <
v~.~ <#"="?<
-
#?"+"^t
0
V
#?"="  >"1"-v
/ {   <^"+"?<
>     ^

Will only work for numbers where the calculated value <256 due to limitations in the values that can be held by pointers in Cardinal
Try it Online
Explanation:
Step 1
%:.~:#"^"."="

Receives two numbers a and b as input and outputs as "a^b="
Passes a pointer with active value a and inactive value b
Step 2
        >v
        "~
        *.
>~=088v "~
v88+88< ?
8       -
8      x#<
v     < 0
>   t / <

Receives a pointer with active value a and inactive value b printing "a"+("*a")(b-1) times
Passes a pointer with active value a^(b-1) to the next part
Step 3
v~.~ <#"="?<
-
#?"+"^t
0
V
#?"="
/ {   <
>     ^

Receives a pointer with value of a^(b-1) and outputs "=a"+("+a")repeated(a^(b-1)-1)times+"="
Passes a pointer with value a^b to the next part
Step 4
>"1"-v
^"+"?<

Receives a pointer with value a^b and prints out "1"+("+1")repeated a^b-1 times

Retina, 89 88 bytes
*`,
^
+`(1+),1
$1*$1,
:`.1+.$

{`^[1+]+
a$&z
+`a(.+)z.1
$1+a$1z*
)`.a.+z.

:`a

+`11
1+1

Input is comma separated unary numbers.
Try it online!

Pyth, 32 31 bytes
AQjMC,"^*++"[Q*]GH*^GtH]G*]1^GH

Takes input as [2,10], outputs as ["2^10", "2*2*2*2*2*2*2*2*2*2", "2+2+...
Explanation:
Q = eval(input())                     #
G, H = Q                              #  AQ
operators = "^*++"                    #        "^*++"
operands = [Q,                        #              [Q
  [G]*H,                              #                *]GH
  G**(H-1)*[G]                        #                    *^GtH]G
  [1]*G**H                            #                           *]1^GH
]                                     #
map( lambda d: join(*d),              #    jM
     zip(operators, operands)         #      C,...
)                                     #

Try it here.

Perl, 81 bytes
78 bytes of code + -n flag (counted as 3 bytes since the code contains $').
$,=$/;print s/ /^/r,map{/\D/;join$&,($`)x$'}"$`*$'","$`+".$`**~-$',"1+".$`**$'

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes